@nuskin/ns-product-lib 2.7.0-cx24-337703.1 → 2.7.0-cx24-3682.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +3 -10
- package/package.json +2 -2
- package/src/models/productNotFound.js +0 -0
- package/src/productData.js +22 -38
package/CHANGELOG.md
CHANGED
@@ -1,16 +1,9 @@
|
|
1
|
-
# [2.7.0-cx24-
|
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
|
-
###
|
5
|
-
|
6
|
-
* Merge CX24-3563 changes to CX24-337703 ([9e6ca40](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/9e6ca40c35252c24394351275a234e9847f70bfc))
|
7
|
-
|
8
|
-
## [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)
|
9
|
-
|
10
|
-
|
11
|
-
### Fix
|
4
|
+
### New
|
12
5
|
|
13
|
-
*
|
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)
|
14
7
|
|
15
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)
|
16
9
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nuskin/ns-product-lib",
|
3
|
-
"version": "2.7.0-cx24-
|
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.
|
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/productData.js
CHANGED
@@ -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
|
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":
|
247
|
-
"pv":
|
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":
|
261
|
-
"WADW":
|
262
|
-
"WHL":
|
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":
|
266
|
-
"WADW":
|
267
|
-
"WHL":
|
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":
|
424
|
-
"pv":
|
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":
|
438
|
-
"WADW":
|
439
|
-
"WHL":
|
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":
|
443
|
-
"WADW":
|
444
|
-
"WHL":
|
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),
|