Skip to content

Commit 1d8e166

Browse files
koenner01Mastiuhin Oleksandr
authored andcommitted
Refactored the parameters passed in the 'ajax:addToCart' trigger when adding a product to the cart. The code now leans more closely to how this type of event triggering has already been implemented in Magento
1 parent 447a24d commit 1d8e166

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/code/Magento/Catalog/view/frontend/web/js/catalog-add-to-cart.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@ define([
9797
success: function (res) {
9898
var eventData, parameters;
9999

100-
$(document).trigger('ajax:addToCart', form.data().productSku, form, res);
100+
$(document).trigger('ajax:addToCart', {
101+
'sku': form.data().productSku,
102+
'form': form,
103+
'response': res
104+
});
101105

102106
if (self.isLoaderEnabled()) {
103107
$('body').trigger(self.options.processStop);

0 commit comments

Comments
 (0)