@nuskin/ns-shop 7.2.3-td-1017.1 → 7.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/src/cart/cart.js +10 -2
- package/src/order/orderAdapter.js +11 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuskin/ns-shop",
|
|
3
|
-
"version": "7.2.3
|
|
3
|
+
"version": "7.2.3",
|
|
4
4
|
"description": "The description that will amaze and astound your audience when they read it",
|
|
5
5
|
"main": "src/shop.js",
|
|
6
6
|
"scripts": {
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"@nuskin/ns-common-lib": "1.4.7",
|
|
27
27
|
"@nuskin/ns-feature-flags": "1.4.7",
|
|
28
28
|
"@nuskin/ns-loyalty-web": "1.5.6",
|
|
29
|
-
"@nuskin/ns-product-lib": "2.19.
|
|
29
|
+
"@nuskin/ns-product-lib": "2.19.2",
|
|
30
30
|
"@nuskin/nuskinjquery": "2.3.1",
|
|
31
31
|
"@nuskin/order-model": "3.1.3",
|
|
32
|
-
"@nuskin/product-lib": "2.
|
|
32
|
+
"@nuskin/product-lib": "2.2.1",
|
|
33
33
|
"@nuskin/ns-util": "4.7.0",
|
|
34
|
-
"axios": "1.
|
|
34
|
+
"axios": "1.7.9",
|
|
35
35
|
"decimal.js": "10.4.3",
|
|
36
36
|
"jp-conversion": "0.0.7",
|
|
37
37
|
"lodash": "4.17.21",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"moment": "2.29.4",
|
|
92
92
|
"json5": "2.2.3",
|
|
93
93
|
"ip": "2.0.1",
|
|
94
|
-
"axios": "1.
|
|
94
|
+
"axios": "1.7.9",
|
|
95
95
|
"merge": "2.1.1",
|
|
96
96
|
"glob-parent": "6.0.2",
|
|
97
97
|
"follow-redirects": "1.15.5",
|
package/src/cart/cart.js
CHANGED
|
@@ -1329,8 +1329,16 @@ export default function Cart(cartData) {
|
|
|
1329
1329
|
const customPayloadMetadata = storage.metadata.CUSTOM_EVENT_PAYLOAD;
|
|
1330
1330
|
let customPayload = storage.getItem(customPayloadMetadata);
|
|
1331
1331
|
if (customPayload) {
|
|
1332
|
-
if (customPayload.
|
|
1333
|
-
|
|
1332
|
+
if (customPayload.catalogAddToCart) {
|
|
1333
|
+
delete customPayload.catalogAddToCart;
|
|
1334
|
+
const product = json.ecommerce.add && json.ecommerce.add.products && json.ecommerce.add.products[0];
|
|
1335
|
+
if (product) {
|
|
1336
|
+
Object.assign(product, customPayload);
|
|
1337
|
+
}
|
|
1338
|
+
} else {
|
|
1339
|
+
if (customPayload.constructor === {}.constructor) {
|
|
1340
|
+
Object.assign(json, customPayload);
|
|
1341
|
+
}
|
|
1334
1342
|
}
|
|
1335
1343
|
storage.removeItem(customPayloadMetadata);
|
|
1336
1344
|
}
|
|
@@ -9,7 +9,7 @@ import pickupUtil from '../shipping/pickupUtil';
|
|
|
9
9
|
import { storage } from "@nuskin/ns-util";
|
|
10
10
|
|
|
11
11
|
let splitLineItems = [];
|
|
12
|
-
const utmInfo = storage.getItem(storage.metadata.UTM_INFO);
|
|
12
|
+
const utmInfo = storage.getItem(storage.metadata.UTM_INFO) || {};
|
|
13
13
|
const addToCustomList = (customList, type, key, value) => {
|
|
14
14
|
if (value) {
|
|
15
15
|
let found = false;
|
|
@@ -497,14 +497,10 @@ const populateCategory = (salesOrder) => {
|
|
|
497
497
|
} else if (util.getSponsorId()) {
|
|
498
498
|
// affiliates don't use a subdomain. So if we have a sponsor and it isn't a pitch then we consider it a storefront
|
|
499
499
|
salesOrder.Category = "STOREFRONT";
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
salesOrder.Category = 'PAIDAD';
|
|
505
|
-
} else {
|
|
506
|
-
salesOrder.Category = 'WEB';
|
|
507
|
-
}
|
|
500
|
+
} else if (utmInfo.utm_medium && utmInfo.utm_medium.includes('paidsearch')) {
|
|
501
|
+
salesOrder.Category = 'PAIDSEARCH';
|
|
502
|
+
} else if (utmInfo.utm_medium && utmInfo.utm_medium.includes('paidsocial')) {
|
|
503
|
+
salesOrder.Category = 'PAIDAD';
|
|
508
504
|
} else {
|
|
509
505
|
salesOrder.Category = 'WEB';
|
|
510
506
|
}
|
|
@@ -1040,12 +1036,12 @@ const populateSalesOrder = (action, adr) => {
|
|
|
1040
1036
|
if (user && user.isGuest) {
|
|
1041
1037
|
addToCustomList(salesOrder.Custom, "FLAG", "GUEST", "TRUE");
|
|
1042
1038
|
}
|
|
1043
|
-
addToCustomList(salesOrder.Custom, "FLAG", "UTM_SOURCE", utmInfo
|
|
1044
|
-
addToCustomList(salesOrder.Custom, "FLAG", "UTM_MEDIUM", utmInfo
|
|
1045
|
-
addToCustomList(salesOrder.Custom, "FLAG", "UTM_CAMPAIGN", utmInfo
|
|
1046
|
-
addToCustomList(salesOrder.Custom, "FLAG", "UTM_CAMPAIGN_ID", utmInfo
|
|
1047
|
-
addToCustomList(salesOrder.Custom, "FLAG", "UTM_CONTENT", utmInfo
|
|
1048
|
-
addToCustomList(salesOrder.Custom, "FLAG", "UTM_TERM", utmInfo
|
|
1039
|
+
addToCustomList(salesOrder.Custom, "FLAG", "UTM_SOURCE", utmInfo.utm_source);
|
|
1040
|
+
addToCustomList(salesOrder.Custom, "FLAG", "UTM_MEDIUM", utmInfo.utm_medium);
|
|
1041
|
+
addToCustomList(salesOrder.Custom, "FLAG", "UTM_CAMPAIGN", utmInfo.utm_campaign);
|
|
1042
|
+
addToCustomList(salesOrder.Custom, "FLAG", "UTM_CAMPAIGN_ID", utmInfo.utm_id);
|
|
1043
|
+
addToCustomList(salesOrder.Custom, "FLAG", "UTM_CONTENT", utmInfo.utm_content);
|
|
1044
|
+
addToCustomList(salesOrder.Custom, "FLAG", "UTM_TERM", utmInfo.utm_term);
|
|
1049
1045
|
const microsite = getCachedConfigField('microsite');
|
|
1050
1046
|
if (microsite) {
|
|
1051
1047
|
salesOrder.Reason = "CUSTOM";
|