@nuskin/ns-shop 7.0.3 → 7.1.0-cx24-6991.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-shop",
3
- "version": "7.0.3",
3
+ "version": "7.1.0-cx24-6991.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.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.17.1",
29
+ "@nuskin/ns-product-lib": "2.17.0",
30
30
  "@nuskin/nuskinjquery": "2.3.1",
31
31
  "axios": "1.6.5",
32
32
  "decimal.js": "10.4.3",
@@ -40,7 +40,7 @@
40
40
  "@nuskin/exclusive-offer-sdk": "1.2.4",
41
41
  "@nuskin/ns-account": "5.9.2",
42
42
  "@nuskin/ns-jsanalyzer": "1.0.1",
43
- "@nuskin/ns-product": "3.50.1",
43
+ "@nuskin/ns-product": "3.50.0",
44
44
  "@nuskin/ns-util": "4.5.4",
45
45
  "axios-mock-adapter": "1.22.0",
46
46
  "babel-cli": "6.26.0",
@@ -489,10 +489,7 @@ async function getAddToCartQty(product) {
489
489
  retVal = product.maxQuantity - cartQty;
490
490
  if (product.isExclusive) {
491
491
  try {
492
- const qual = await QualificationService.getQualification(product.sku);
493
- if (!qual) {
494
- return 0;
495
- }
492
+ const qual = await QualificationService.getQualification(product.sku)
496
493
  const productIdentifier = qual.productId || qual.sku;
497
494
  cartQty = await getBaseSkuCartQuantity(productIdentifier)
498
495
  retVal = product.maxQuantity - cartQty;
@@ -46,8 +46,15 @@ function _getEquinoxSession() {
46
46
  method: 'GET',
47
47
  endpoint: 'customers'
48
48
  }
49
+ const customerSession = sessionStorage.getItem('customerSession') ? JSON.parse(sessionStorage.getItem('customerSession')) : ''
50
+ if (customerSession === '') {
51
+ sessionStorage.setItem('customerSession', true)
52
+ return _equinoxRequest(equinoxRequestOptions)
53
+ } else {
54
+ return null
55
+ }
56
+
49
57
 
50
- return _equinoxRequest(equinoxRequestOptions);
51
58
  }
52
59
 
53
60
  /**
@@ -262,6 +269,7 @@ async function getAddToCartQty(product) {
262
269
  const qualification = await QualificationService.getQualification(product.sku)
263
270
  qualifiedQuantity = qualification.isConsumable ? qualification.quantity : 0
264
271
  } catch (err) {
272
+ console.error(err)
265
273
  qualifiedQuantity = 0;
266
274
  }
267
275
  }
@@ -393,7 +401,6 @@ function _assembleChildSkus(requestData, options) {
393
401
  if(personalOffer != null && productWithVariant.length > 0 && productWithVariant[0].variantSelected){
394
402
  selectedVariants = productWithVariant[0].variantSelected;
395
403
  }
396
- if (personalOffer != null && selectedVariants && cs.skuId != selectedVariants[cs.productId] && cs.type !== "BUNDLE") return null
397
404
  const childSku =
398
405
  (personalOffer != null && selectedVariants && selectedVariants[cs.productId] && config.MySite_graphql_active)
399
406
  ? {
@@ -414,7 +421,6 @@ function _assembleChildSkus(requestData, options) {
414
421
 
415
422
  return childSku;
416
423
  });
417
- requestData.skus = requestData.skus.filter(n => n)
418
424
  }
419
425
 
420
426
  return requestData;