Skip to content

Commit

Permalink
Add fixes from #6 to get event to fire
Browse files Browse the repository at this point in the history
  • Loading branch information
njparadis committed Aug 30, 2021
1 parent ca7192e commit a339d97
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,13 @@ var buildDataLayer = function () {
}

// Order Placed Event
if (pageContext == 'orderconfirmation' && orderID) {
if (orderID && !empty(orderID.rawValue)) {
KlaviyoUtils = require('*/cartridge/scripts/utils/klaviyo/klaviyoUtils');

if (!dw.system.Site.getCurrent().getCustomPreferenceValue('klaviyo_order_transactional_enabled')) {
return;
}
currentOrder = orderMgr.getOrder(orderID);
KlaviyoUtils.prepareOrderConfirmationEventForKlaviyo(currentOrder);
if (currentOrder.status == 3 || currentOrder.status == 4) {
KlaviyoUtils.prepareOrderConfirmationEventForKlaviyo(currentOrder);
}
}


Expand Down

0 comments on commit a339d97

Please sign in to comment.