Skip to content

Commit

Permalink
[SD-905] Adds product_add_to_cart event triggering
Browse files Browse the repository at this point in the history
This event is needed by spree_analytics_trackers extension
to show up Product Added event in Segment and Google Analytics
  • Loading branch information
aplegatt authored and damianlegawiec committed Jul 23, 2020
1 parent c9d8a77 commit b3e3466
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,12 @@ Spree.ready(function($) {
Spree.showProductAddedModal(JSON.parse(
$cartForm.attr('data-product-summary')
), Spree.variantById($cartForm, variantId))
$cartForm.trigger({
type: 'product_add_to_cart',
variant: Spree.variantById($cartForm, variantId),
quantity_increment: quantity,
cart: response.attributes
})
},
function(error) {
if (typeof error === 'string' && error !== '') {
Expand Down

0 comments on commit b3e3466

Please sign in to comment.