@nuskin/ns-product-lib 2.6.0-cx24-3372.2 → 2.6.0-cx24-3372.3
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/productData.js +31 -30
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# [2.6.0-cx24-3372.3](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.0-cx24-3372.2...v2.6.0-cx24-3372.3) (2023-03-02)
|
2
|
+
|
3
|
+
|
4
|
+
### Fix
|
5
|
+
|
6
|
+
* Kit mapping ([af76396](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/af76396940d95988bbcfad73fc047381945847bb))
|
7
|
+
|
1
8
|
# [2.6.0-cx24-3372.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.0-cx24-3372.1...v2.6.0-cx24-3372.2) (2023-03-01)
|
2
9
|
|
3
10
|
|
package/package.json
CHANGED
package/src/productData.js
CHANGED
@@ -331,7 +331,8 @@ const ProductData = {
|
|
331
331
|
let variants = {};
|
332
332
|
|
333
333
|
let prodArr = productDataResponse.map((data) => {
|
334
|
-
let
|
334
|
+
let product = (data.type && data.type === "kit") ? data : data.sku[count];
|
335
|
+
let imageURL = product.properties.imageURL;
|
335
336
|
const regex = /\d+.\d+/
|
336
337
|
let thumbnailImage = ''
|
337
338
|
|
@@ -354,15 +355,15 @@ const ProductData = {
|
|
354
355
|
eventLabels,
|
355
356
|
computedPrice,
|
356
357
|
defaultProductPrice
|
357
|
-
} = this.getEqProductPromotions(
|
358
|
-
const productPrice = eventName ? defaultProductPrice :
|
359
|
-
const discountedPrice = eventName ? computedPrice :
|
358
|
+
} = this.getEqProductPromotions(product);
|
359
|
+
const productPrice = eventName ? defaultProductPrice : product.priceFacets["Regular Price"];
|
360
|
+
const discountedPrice = eventName ? computedPrice : product.priceFacets["Regular Price"];
|
360
361
|
|
361
362
|
prod = {
|
362
|
-
"sku":
|
363
|
+
"sku": product.identifier,
|
363
364
|
"globalProductID": data.identifier,
|
364
365
|
"title": data.properties.name,
|
365
|
-
"country":
|
366
|
+
"country": product.properties.market,
|
366
367
|
"language": "en",
|
367
368
|
"shortDescr": data.properties.description,
|
368
369
|
"longDescr": data.properties.productDetailsDescription,
|
@@ -379,7 +380,7 @@ const ProductData = {
|
|
379
380
|
"ingredients": data.properties.ingredients,
|
380
381
|
"benefits": data.properties.benefits,
|
381
382
|
"usage": data.properties.usage,
|
382
|
-
"resources":
|
383
|
+
"resources": product.properties.resources,
|
383
384
|
"videos": "",
|
384
385
|
"movie": "",
|
385
386
|
"youtube": "",
|
@@ -390,48 +391,48 @@ const ProductData = {
|
|
390
391
|
}
|
391
392
|
],
|
392
393
|
"scanQualified": data.properties.scanQualifiedCount,
|
393
|
-
"availableQuantity":
|
394
|
+
"availableQuantity": product.inventoryProperties.atpQty,
|
394
395
|
"maxQuantity": 999,
|
395
396
|
"points": "",
|
396
|
-
"cv": (
|
397
|
-
"pv":
|
397
|
+
"cv": (product.priceFacets.CV) ? product.priceFacets.CV : '',
|
398
|
+
"pv": product.priceFacets.PV,
|
398
399
|
"priceType": "WRTL",
|
399
400
|
"price": discountedPrice,
|
400
401
|
"priceMap": {
|
401
402
|
"WRTL": productPrice,
|
402
|
-
"WADW-WRTL":
|
403
|
-
"WADR":
|
404
|
-
"RTL":
|
405
|
-
"WADW":
|
406
|
-
"WHL":
|
407
|
-
"WWHL":
|
403
|
+
"WADW-WRTL": product.priceFacets["Regular Price"],
|
404
|
+
"WADR": product.priceFacets["Regular Price"],
|
405
|
+
"RTL": product.priceFacets["Regular Price"],
|
406
|
+
"WADW": product.priceFacets["Wholesale Price"],
|
407
|
+
"WHL": product.priceFacets["Wholesale Price"],
|
408
|
+
"WWHL": product.priceFacets["Wholesale Price"]
|
408
409
|
},
|
409
410
|
"cvMap": {
|
410
|
-
"WWHL": (
|
411
|
-
"WADW": (
|
412
|
-
"WHL": (
|
411
|
+
"WWHL": (product.priceFacets.CV) ? product.priceFacets.CV : '',
|
412
|
+
"WADW": (product.priceFacets.CV) ? product.priceFacets.CV : '',
|
413
|
+
"WHL": (product.priceFacets.CV) ? product.priceFacets.CV : ''
|
413
414
|
},
|
414
415
|
"pvMap": {
|
415
|
-
"WWHL":
|
416
|
-
"WADW":
|
417
|
-
"WHL":
|
416
|
+
"WWHL": product.priceFacets.PV,
|
417
|
+
"WADW": product.priceFacets.PV,
|
418
|
+
"WHL": product.priceFacets.PV
|
418
419
|
},
|
419
|
-
"orderTypes": this._setOrderType(
|
420
|
+
"orderTypes": this._setOrderType(product.properties),
|
420
421
|
"childSkus": [],
|
421
|
-
"custTypes": this.switchCustType(
|
422
|
+
"custTypes": this.switchCustType(product.properties.customerTypes),
|
422
423
|
"division": data.properties.division,
|
423
424
|
"backOrderDate": null,
|
424
425
|
"locallyProduced": false,
|
425
426
|
"agelocme": null,
|
426
427
|
"count": "",
|
427
428
|
"flavor": "",
|
428
|
-
"size":
|
429
|
+
"size": product.properties.size,
|
429
430
|
"shade": "",
|
430
|
-
"status": this.switchStatusFromEquinox(
|
431
|
+
"status": this.switchStatusFromEquinox(product.properties.productStatus),
|
431
432
|
"variantType": "Other",
|
432
|
-
"variantDropdownLabel":
|
433
|
+
"variantDropdownLabel": product.properties.variantLabel || "",
|
433
434
|
"variantDropdownPlaceholder": "Select Type",
|
434
|
-
"variantsLabel":
|
435
|
+
"variantsLabel": product.properties.variantLabel || "",
|
435
436
|
"groupOffer": false,
|
436
437
|
"personalOffer": false,
|
437
438
|
"savedEventName": eventName,
|
@@ -441,7 +442,7 @@ const ProductData = {
|
|
441
442
|
"nettoWeight": "",
|
442
443
|
"variants": variants,
|
443
444
|
"searchScore": 0,
|
444
|
-
"isExclusive":
|
445
|
+
"isExclusive": product.properties.isExclusive || false,
|
445
446
|
"marketAttributes": {
|
446
447
|
"discount": true,
|
447
448
|
"redeem": true,
|
@@ -449,7 +450,7 @@ const ProductData = {
|
|
449
450
|
},
|
450
451
|
"restrictedMarkets": [],
|
451
452
|
"addOns": [],
|
452
|
-
"inventory":
|
453
|
+
"inventory": product.inventory || "", //inventory label
|
453
454
|
"equinoxProductId": data.identifier
|
454
455
|
};
|
455
456
|
let newProduct = new Product(prod);
|