@nuskin/ns-shop 7.9.0-6056-insider.2 → 7.9.0-mdigi-6056.1
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 +2 -2
- package/src/cart/cart.js +2 -0
- package/src/cart/cartItem.js +1 -1
- package/src/cart/cartService.js +7 -1
- package/src/order/orderAdapter.js +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuskin/ns-shop",
|
|
3
|
-
"version": "7.9.0-6056
|
|
3
|
+
"version": "7.9.0-mdigi-6056.1",
|
|
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,7 +26,7 @@
|
|
|
26
26
|
"@nuskin/ns-common-lib": "1.4.8",
|
|
27
27
|
"@nuskin/ns-feature-flags": "1.5.0",
|
|
28
28
|
"@nuskin/ns-loyalty-web": "1.5.7",
|
|
29
|
-
"@nuskin/ns-product-lib": "2.
|
|
29
|
+
"@nuskin/ns-product-lib": "2.22.0-mdigi-6056.1",
|
|
30
30
|
"@nuskin/nuskinjquery": "2.3.1",
|
|
31
31
|
"@nuskin/order-model": "3.1.3",
|
|
32
32
|
"@nuskin/product-lib": "2.4.0",
|
package/src/cart/cart.js
CHANGED
|
@@ -281,6 +281,8 @@ export default function Cart(cartData) {
|
|
|
281
281
|
if (cartItem.isAgelocme()) {
|
|
282
282
|
product.agelocme = cartItem.product.agelocme;
|
|
283
283
|
}
|
|
284
|
+
const eventNames = cartItem.product.eventName ? [cartItem.product.eventName] : null;
|
|
285
|
+
product.setPriceAndPvFromType(cartItem.product.priceType, eventNames);
|
|
284
286
|
cartItem.product = product;
|
|
285
287
|
publish(events.shop.CART_UPDATED, {
|
|
286
288
|
modify: {
|
package/src/cart/cartItem.js
CHANGED
|
@@ -377,7 +377,7 @@ export default function CartItem(cartItemData) {
|
|
|
377
377
|
retVal.variants = this.product.variants;
|
|
378
378
|
retVal.marketAttributes = this.product.marketAttributes;
|
|
379
379
|
retVal.product_image_url = this.product.fullImage;
|
|
380
|
-
retVal.taxonomy = this.product.
|
|
380
|
+
retVal.taxonomy = this.product.categories?.[0]?.displayName || 'Nu Skin';
|
|
381
381
|
retVal.salesPrice = AccountManager.isLoggedIn()? this.salesPrice() : null;
|
|
382
382
|
retVal.unitPrice = AccountManager.isLoggedIn()? this.unitPrice() : null;
|
|
383
383
|
|
package/src/cart/cartService.js
CHANGED
|
@@ -762,7 +762,13 @@ async function checkProductLanguages() {
|
|
|
762
762
|
const promises = [];
|
|
763
763
|
const changeditems = []
|
|
764
764
|
_getCart().getItems({cartItems: true}).forEach((cartItem) => {
|
|
765
|
-
if
|
|
765
|
+
// if there is no language (lang) set on the product this is a variant and variants
|
|
766
|
+
// do not have this set. It likely has the correct language used for product data.
|
|
767
|
+
if (!cartItem.product.lang) {
|
|
768
|
+
cartItem.product.lang = runConfig.language;
|
|
769
|
+
promises.push(Promise.resolve({product: cartItem.product}));
|
|
770
|
+
changeditems.push(cartItem);
|
|
771
|
+
} else if (runConfig.language !== cartItem.product.lang) {
|
|
766
772
|
promises.push(ProductService.getProductBySku({
|
|
767
773
|
cntryCd: runConfig.country,
|
|
768
774
|
language: runConfig.language,
|
|
@@ -503,7 +503,8 @@ const populateCategory = (salesOrder) => {
|
|
|
503
503
|
} else if (util.getSponsorId()) {
|
|
504
504
|
// affiliates don't use a subdomain. So if we have a sponsor and it isn't a pitch then we consider it a storefront
|
|
505
505
|
salesOrder.Category = "STOREFRONT";
|
|
506
|
-
} else if (utmMedium &&
|
|
506
|
+
} else if (utmMedium &&
|
|
507
|
+
(utmMedium.toLowerCase().includes('cpc') || utmMedium.toLowerCase().includes('paidsearch'))) {
|
|
507
508
|
salesOrder.Category = 'PAIDSEARCH';
|
|
508
509
|
} else if (utmMedium && utmMedium.toLowerCase().includes('paidsocial')) {
|
|
509
510
|
salesOrder.Category = 'PAIDAD';
|