{"action":"opened","issue":{"url":"https://api.github.com/repos/woothemes/woocommerce/issues/11119","repository_url":"https://api.github.com/repos/woothemes/woocommerce","labels_url":"https://api.github.com/repos/woothemes/woocommerce/issues/11119/labels{/name}","comments_url":"https://api.github.com/repos/woothemes/woocommerce/issues/11119/comments","events_url":"https://api.github.com/repos/woothemes/woocommerce/issues/11119/events","html_url":"https://github.com/woothemes/woocommerce/issues/11119","id":160234046,"number":11119,"title":"Provide global JS event when cart is updated via AJAX","user":{"login":"gedex","id":78313,"avatar_url":"https://avatars.githubusercontent.com/u/78313?v=3","gravatar_id":"","url":"https://api.github.com/users/gedex","html_url":"https://github.com/gedex","followers_url":"https://api.github.com/users/gedex/followers","following_url":"https://api.github.com/users/gedex/following{/other_user}","gists_url":"https://api.github.com/users/gedex/gists{/gist_id}","starred_url":"https://api.github.com/users/gedex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gedex/subscriptions","organizations_url":"https://api.github.com/users/gedex/orgs","repos_url":"https://api.github.com/users/gedex/repos","events_url":"https://api.github.com/users/gedex/events{/privacy}","received_events_url":"https://api.github.com/users/gedex/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/woothemes/woocommerce/labels/Enhancement","name":"Enhancement","color":"f9d0c4"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-14T17:06:35Z","updated_at":"2016-06-14T17:06:35Z","closed_at":null,"body":"## EXPLANATION OF THE ISSUE\r\n\r\n<!-- What happens, under which versions, under what conditions, when, and what were you expecting instead. -->\r\n\r\nCurrently, we need to register callback to two events, `updated_wc_div` and `updated_cart_totals`, to hook a callback when cart is updated. When coupon is applied or removed, `updated_cart_totals` is triggered, but not `updated_wc_div`. For `updated_wc_div` to be triggered, actions other than coupon-related need to be performed.\r\n\r\nFor event name, `updated_cart_totals`, sounds to be triggered when item's qty is updated as when qty is updated it should affects cart totals too.\r\n\r\n## STEPS TO REPRODUCE THE ISSUE\r\n\r\nAdd product to a cart. In cart page, register a callback like this in browser's console:\r\n\r\n~~~js\r\njQuery( document.body ).on( 'updated_cart_totals', function() { console.log( 'cart updated' ); } );\r\n~~~\r\n\r\nthen update item's qty in your cart. Callback is not fired. But when coupon is applied, callback is fired. Same thing for `updated_wc_div`, the callback won't be fired when coupon is applied. \r\n\r\n\r\n"}}
{"actor":{"display_login":"gedex"}}