Adding product data to `removed_from_cart` event
Adding `$thisbutton.data()` to the arguments sent by the `removed_from_cart` event. This would help developers easily detect which product has just been removed and alter their theme/plugin accordingly.
This commit is contained in:
parent
ef00985e44
commit
bca7bfe29c
|
@ -86,7 +86,7 @@ jQuery( function( $ ) {
|
|||
window.location = $thisbutton.attr( 'href' );
|
||||
return;
|
||||
}
|
||||
$( document.body ).trigger( 'removed_from_cart', [ response.fragments, response.cart_hash ] );
|
||||
$( document.body ).trigger( 'removed_from_cart', [ response.fragments, response.cart_hash, $thisbutton.data() ] );
|
||||
}).fail( function() {
|
||||
window.location = $thisbutton.attr( 'href' );
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue