@nuskin/ns-product-lib 2.7.0-cx24-337705.1 → 2.7.0-cx24-3682.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/CHANGELOG.md CHANGED
@@ -1,24 +1,9 @@
1
- # [2.7.0-cx24-337705.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0-cx24-337703.1...v2.7.0-cx24-337705.1) (2023-03-23)
1
+ # [2.7.0-cx24-3682.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.1...v2.7.0-cx24-3682.1) (2023-03-24)
2
2
 
3
3
 
4
- ### Fix
5
-
6
- * Added override flag for equinox products ([d098245](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/d098245007f453e33cae8fb574dad61fadfc1e5e))
7
- * Added override flag for equinox products ([2f4af3d](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/2f4af3d5f7fcfa14f23c9cd18eacfaaa9262e0a0))
8
-
9
- # [2.7.0-cx24-337703.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.2-cx24-337703.1...v2.7.0-cx24-337703.1) (2023-03-22)
10
-
11
-
12
- ### Update
13
-
14
- * Merge CX24-3563 changes to CX24-337703 ([9e6ca40](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/9e6ca40c35252c24394351275a234e9847f70bfc))
15
-
16
- ## [2.6.2-cx24-337703.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.1...v2.6.2-cx24-337703.1) (2023-03-22)
17
-
18
-
19
- ### Fix
4
+ ### New
20
5
 
21
- * Show dropdown for variants ([85cdf69](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/85cdf69cc2bbf6700ec5c9bcacc7222cf2ddf674))
6
+ * MySite product cards show blank data when users have setup AEM Base SKU's(55) in Admin #CX24-3682 ([99cc11a](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/99cc11a7a274d97c03efc0a4bcdd0e03eb7b552a)), closes [#CX24-3682](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3682)
22
7
 
23
8
  ## [2.6.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.0...v2.6.1) (2023-03-16)
24
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.7.0-cx24-337705.1",
3
+ "version": "2.7.0-cx24-3682.1",
4
4
  "description": "This project contains shared Product models and code between the backend and frontend.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "@nuskin/configuration-sdk": "2.2.3",
35
35
  "@nuskin/ns-common-lib": "1.4.5",
36
- "@nuskin/ns-util": "4.2.7",
36
+ "@nuskin/ns-util": "4.2.5",
37
37
  "axios": "0.27.2",
38
38
  "qs": "6.11.0"
39
39
  },
File without changes
package/src/product.js CHANGED
@@ -325,15 +325,10 @@ const Product = function(productData) {
325
325
  return this.addCvWithType(csvKey, productStatus.csv[csvKey]);
326
326
  }, this);
327
327
  }
328
-
329
- //dont override orderTypes and childSkus when product came from equinox
330
- if(!this.equinoxProductId) {
331
- this.orderTypes = ProductUtils.mergeOrderTypes(this.orderTypes, productStatus.orderType);
332
- if(productStatus.childSkus) {
333
- this.childSkus = productStatus.childSkus;
334
- }
328
+ this.orderTypes = ProductUtils.mergeOrderTypes(this.orderTypes, productStatus.orderType);
329
+ if(productStatus.childSkus) {
330
+ this.childSkus = productStatus.childSkus;
335
331
  }
336
-
337
332
  this.setPriceAndPvFromType(priceType, null, option);
338
333
  modified = true;
339
334
  } else {
@@ -34,6 +34,7 @@ const ProductData = {
34
34
 
35
35
  getProductFromEquinox: async function (skus, locale, config) {
36
36
  const response = await this.searchEquinoxProduct(skus, locale, config);
37
+ console.log(response);
37
38
 
38
39
  if (response.data.product) {
39
40
  return await this.eqProductMapper(response.data.product, skus);
@@ -66,6 +67,7 @@ const ProductData = {
66
67
  }
67
68
 
68
69
  const filter = skuFilter.join(" OR ")
70
+ //axios.defaults.withCredentials = true;
69
71
 
70
72
  const url = `${config.API_Base_URLs}/orchestrationservices/storefront/catalogs/search/`;
71
73
  const href = `${url}?filter='\\\\''${encodeURI(filter)}'\\''`;
@@ -132,11 +134,9 @@ const ProductData = {
132
134
  let thumbnailImage = imageURL ? imageURL + '?width=40' : ''
133
135
 
134
136
 
135
- const { eventName, eventLabels, computedPrice, defaultProductPrice, CVPrice, PVPrice } = this.getEqProductPromotions(eqVariant);
137
+ const { eventName, eventLabels, computedPrice, defaultProductPrice } = this.getEqProductPromotions(eqVariant);
136
138
  const productPrice = eventName ? defaultProductPrice : eqVariant.priceFacets["Regular Price"];
137
139
  const discountedPrice = eventName ? computedPrice : eqVariant.priceFacets["Regular Price"];
138
- const productCVPrice = eventName ? CVPrice : eqVariant.priceFacets.CV;
139
- const productPVPrice = eventName ? PVPrice : eqVariant.priceFacets.PV;
140
140
 
141
141
  return {
142
142
  "sku": eqVariant.identifier,
@@ -243,8 +243,8 @@ const ProductData = {
243
243
  "availableQuantity": eqVariant.inventoryProperties.atpQty,
244
244
  "maxQuantity": 999,
245
245
  "points": "",
246
- "cv": productCVPrice,
247
- "pv": productPVPrice,
246
+ "cv": (eqVariant.priceFacets.CV) ? eqVariant.priceFacets.CV : '',
247
+ "pv": eqVariant.priceFacets.PV,
248
248
  "priceType": "WRTL",
249
249
  "price": discountedPrice,
250
250
  "priceMap": {
@@ -257,14 +257,14 @@ const ProductData = {
257
257
  "WHL": eqVariant.priceFacets["Wholesale Price"]
258
258
  },
259
259
  "cvMap": {
260
- "WWHL": productCVPrice,
261
- "WADW": productCVPrice,
262
- "WHL": productCVPrice
260
+ "WWHL": (eqVariant.priceFacets.CV) ? eqVariant.priceFacets.CV : '',
261
+ "WADW": (eqVariant.priceFacets.CV) ? eqVariant.priceFacets.CV : '',
262
+ "WHL": (eqVariant.priceFacets.CV) ? eqVariant.priceFacets.CV : ''
263
263
  },
264
264
  "pvMap": {
265
- "WWHL": productPVPrice,
266
- "WADW": productPVPrice,
267
- "WHL": productPVPrice
265
+ "WWHL": eqVariant.priceFacets.PV,
266
+ "WADW": eqVariant.priceFacets.PV,
267
+ "WHL": eqVariant.priceFacets.PV
268
268
  },
269
269
  "orderTypes": this._setOrderType(eqVariant.properties),
270
270
  "custTypes": this.switchCustType(eqVariant.properties.customerTypes),
@@ -321,16 +321,6 @@ const ProductData = {
321
321
  const computedPrice = product.totalValue && product.totalValue.priceAfterDiscount
322
322
  ? product.totalValue.priceAfterDiscount
323
323
  : 0;
324
-
325
- let CVPrice = 0,
326
- PVPrice = 0;
327
-
328
- if(product.totalValue && product.totalValue.priceFacets) {
329
- const productPriceFacets = product.totalValue.priceFacets;
330
- CVPrice = productPriceFacets.CV && productPriceFacets.CV.CVAfterDiscount ? productPriceFacets.CV.CVAfterDiscount : 0;
331
- PVPrice = productPriceFacets.PV && productPriceFacets.PV.PVAfterDiscount ? productPriceFacets.PV.PVAfterDiscount : 0;
332
- }
333
-
334
324
  let eventName = "";
335
325
  const eventLabels = [];
336
326
 
@@ -344,19 +334,17 @@ const ProductData = {
344
334
  eventLabels: eventLabels.join(','),
345
335
  defaultProductPrice,
346
336
  computedPrice,
347
- eventName,
348
- CVPrice,
349
- PVPrice
337
+ eventName
350
338
  }
351
339
  },
352
340
 
353
341
  eqProductMapper: async function (productDataResponse, skus) {
354
342
  let count = 0;
343
+ let variants = {};
355
344
  const products = [];
356
345
 
357
346
  for (const productData of productDataResponse) {
358
347
  try {
359
- let variants = {};
360
348
  let product = (productData.type && productData.type === "kit") ? productData : productData.sku[count];
361
349
  let imageURL = product.properties.imageURL ? product.properties.imageURL : '';
362
350
  let thumbnailImage = imageURL ? imageURL + '?width=40' : ''
@@ -374,14 +362,10 @@ const ProductData = {
374
362
  eventName,
375
363
  eventLabels,
376
364
  computedPrice,
377
- defaultProductPrice,
378
- CVPrice,
379
- PVPrice
365
+ defaultProductPrice
380
366
  } = this.getEqProductPromotions(product);
381
367
  const productPrice = eventName ? defaultProductPrice : product.priceFacets["Regular Price"];
382
368
  const discountedPrice = eventName ? computedPrice : product.priceFacets["Regular Price"];
383
- const productCVPrice = eventName ? CVPrice : product.priceFacets.CV;
384
- const productPVPrice = eventName ? PVPrice : product.priceFacets.PV;
385
369
 
386
370
  product.childSkus = await this.fetchChildSkus(product);
387
371
  product.availableQuantity = mapAvailableQuantity(product);
@@ -420,8 +404,8 @@ const ProductData = {
420
404
  "scanQualified": productData.properties.scanQualifiedCount,
421
405
  "maxQuantity": 999,
422
406
  "points": "",
423
- "cv": productCVPrice,
424
- "pv": productPVPrice,
407
+ "cv": (product.priceFacets.CV) ? product.priceFacets.CV : '',
408
+ "pv": product.priceFacets.PV,
425
409
  "priceType": "WRTL",
426
410
  "price": discountedPrice,
427
411
  "priceMap": {
@@ -434,14 +418,14 @@ const ProductData = {
434
418
  "WWHL": product.priceFacets["Wholesale Price"]
435
419
  },
436
420
  "cvMap": {
437
- "WWHL": productCVPrice,
438
- "WADW": productCVPrice,
439
- "WHL": productCVPrice
421
+ "WWHL": (product.priceFacets.CV) ? product.priceFacets.CV : '',
422
+ "WADW": (product.priceFacets.CV) ? product.priceFacets.CV : '',
423
+ "WHL": (product.priceFacets.CV) ? product.priceFacets.CV : ''
440
424
  },
441
425
  "pvMap": {
442
- "WWHL": productPVPrice,
443
- "WADW": productPVPrice,
444
- "WHL": productPVPrice
426
+ "WWHL": product.priceFacets.PV,
427
+ "WADW": product.priceFacets.PV,
428
+ "WHL": product.priceFacets.PV
445
429
  },
446
430
  "orderTypes": this._setOrderType(product.properties),
447
431
  "custTypes": this.switchCustType(product.properties.customerTypes),