We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 595c1d0 commit f4c2853Copy full SHA for f4c2853
1 file changed
cartridges/int_klaviyo_sfra/cartridge/scripts/utils/klaviyo/klaviyoDataLayer.js
@@ -45,13 +45,14 @@ var buildDataLayer = function () {
45
}
46
47
// Order Placed Event
48
- if (orderID && !empty(orderID.rawValue)) {
+ if (pageContext == 'orderconfirmation' && orderID) {
49
KlaviyoUtils = require('*/cartridge/scripts/utils/klaviyo/klaviyoUtils');
50
51
- currentOrder = orderMgr.getOrder(orderID);
52
- if (currentOrder.status == 3 || currentOrder.status == 4) {
53
- KlaviyoUtils.prepareOrderConfirmationEventForKlaviyo(currentOrder);
+ if (!dw.system.Site.getCurrent().getCustomPreferenceValue('klaviyo_order_transactional_enabled')) {
+ return;
54
+ currentOrder = orderMgr.getOrder(orderID);
55
+ KlaviyoUtils.prepareOrderConfirmationEventForKlaviyo(currentOrder);
56
57
58
0 commit comments