@nuskin/ns-product-lib 2.7.1-cx24-3684.1 → 2.8.0-cx24-3705.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +3 -3
- package/package.json +1 -1
- package/src/productData.js +23 -24
package/CHANGELOG.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
|
1
|
+
# [2.8.0-cx24-3705.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0...v2.8.0-cx24-3705.1) (2023-04-14)
|
2
2
|
|
3
3
|
|
4
|
-
###
|
4
|
+
### Update
|
5
5
|
|
6
|
-
*
|
6
|
+
* setting correct title if multiple variants ([9574804](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/9574804094f65261ff45c9658ba4e4d4baf0bdf2))
|
7
7
|
|
8
8
|
# [2.7.0](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.2...v2.7.0) (2023-04-05)
|
9
9
|
|
package/package.json
CHANGED
package/src/productData.js
CHANGED
@@ -48,11 +48,11 @@ const ProductData = {
|
|
48
48
|
},
|
49
49
|
|
50
50
|
/**
|
51
|
-
*
|
52
|
-
* @param {string[]} skus
|
53
|
-
* @param {string} locale
|
54
|
-
* @param {ConfigMap} config
|
55
|
-
* @returns
|
51
|
+
*
|
52
|
+
* @param {string[]} skus
|
53
|
+
* @param {string} locale
|
54
|
+
* @param {ConfigMap} config
|
55
|
+
* @returns
|
56
56
|
*/
|
57
57
|
searchEquinoxProduct: async function (skus, locale, config) {
|
58
58
|
let skuFilter = [];
|
@@ -140,7 +140,6 @@ const ProductData = {
|
|
140
140
|
const discountedPrice = eventName ? computedPrice : eqVariant.priceFacets["Regular Price"];
|
141
141
|
const productCVPrice = eventName ? CVPrice : eqVariant.priceFacets.CV;
|
142
142
|
const productPVPrice = eventName ? PVPrice : eqVariant.priceFacets.PV;
|
143
|
-
const wholeSalePrice = eventName ? defaultProductPrice : eqVariant.priceFacets["Wholesale Price"];
|
144
143
|
|
145
144
|
return {
|
146
145
|
"sku": eqVariant.identifier,
|
@@ -253,12 +252,12 @@ const ProductData = {
|
|
253
252
|
"price": discountedPrice,
|
254
253
|
"priceMap": {
|
255
254
|
"WRTL": productPrice,
|
256
|
-
"WADW-WRTL":
|
257
|
-
"WADR":
|
258
|
-
"RTL":
|
259
|
-
"WWHL":
|
260
|
-
"WADW":
|
261
|
-
"WHL":
|
255
|
+
"WADW-WRTL": eqVariant.priceFacets["Regular Price"],
|
256
|
+
"WADR": eqVariant.priceFacets["Regular Price"],
|
257
|
+
"RTL": eqVariant.priceFacets["Regular Price"],
|
258
|
+
"WWHL": eqVariant.priceFacets["Wholesale Price"],
|
259
|
+
"WADW": eqVariant.priceFacets["Wholesale Price"],
|
260
|
+
"WHL": eqVariant.priceFacets["Wholesale Price"]
|
262
261
|
},
|
263
262
|
"cvMap": {
|
264
263
|
"WWHL": productCVPrice,
|
@@ -365,7 +364,7 @@ const ProductData = {
|
|
365
364
|
let product = (productData.type && productData.type === "kit") ? productData : productData.sku[count];
|
366
365
|
let imageURL = product.properties.imageURL ? product.properties.imageURL : '';
|
367
366
|
let thumbnailImage = imageURL ? imageURL + '?width=40' : ''
|
368
|
-
|
367
|
+
let productTitle = productData.properties.name
|
369
368
|
|
370
369
|
if (productData.sku && productData.sku.length > 1) {
|
371
370
|
// exclude base product from variants
|
@@ -373,6 +372,8 @@ const ProductData = {
|
|
373
372
|
variants[variant.identifier] = this.eqProductVariantMapper(variant);
|
374
373
|
return variant;
|
375
374
|
});
|
375
|
+
const productArr = productData.sku.filter(p => p.default === true)
|
376
|
+
productTitle = productArr[0].properties.name
|
376
377
|
}
|
377
378
|
|
378
379
|
const {
|
@@ -387,8 +388,6 @@ const ProductData = {
|
|
387
388
|
const discountedPrice = eventName ? computedPrice : product.priceFacets["Regular Price"];
|
388
389
|
const productCVPrice = eventName ? CVPrice : product.priceFacets.CV;
|
389
390
|
const productPVPrice = eventName ? PVPrice : product.priceFacets.PV;
|
390
|
-
const wholeSalePrice = eventName ? defaultProductPrice : product.priceFacets["Wholesale Price"];
|
391
|
-
|
392
391
|
|
393
392
|
product.childSkus = await this.fetchChildSkus(product);
|
394
393
|
product.availableQuantity = mapAvailableQuantity(product);
|
@@ -396,7 +395,7 @@ const ProductData = {
|
|
396
395
|
...product,
|
397
396
|
"sku": product.identifier,
|
398
397
|
"globalProductID": productData.identifier,
|
399
|
-
"title":
|
398
|
+
"title": productTitle,
|
400
399
|
"country": product.properties.market,
|
401
400
|
"language": "en",
|
402
401
|
"shortDescr": productData.properties.description,
|
@@ -432,13 +431,13 @@ const ProductData = {
|
|
432
431
|
"priceType": "WRTL",
|
433
432
|
"price": discountedPrice,
|
434
433
|
"priceMap": {
|
435
|
-
"WRTL": productPrice,
|
436
|
-
"WADW-WRTL":
|
437
|
-
"WADR":
|
438
|
-
"RTL":
|
439
|
-
"WADW":
|
440
|
-
"WHL":
|
441
|
-
"WWHL":
|
434
|
+
"WRTL": productPrice,
|
435
|
+
"WADW-WRTL": product.priceFacets["Regular Price"],
|
436
|
+
"WADR": product.priceFacets["Regular Price"],
|
437
|
+
"RTL": product.priceFacets["Regular Price"],
|
438
|
+
"WADW": product.priceFacets["Wholesale Price"],
|
439
|
+
"WHL": product.priceFacets["Wholesale Price"],
|
440
|
+
"WWHL": product.priceFacets["Wholesale Price"]
|
442
441
|
},
|
443
442
|
"cvMap": {
|
444
443
|
"WWHL": productCVPrice,
|
@@ -513,7 +512,7 @@ const ProductData = {
|
|
513
512
|
};
|
514
513
|
},
|
515
514
|
|
516
|
-
mapEquinoxSKUExists: function(exists) {
|
515
|
+
mapEquinoxSKUExists: function (exists) {
|
517
516
|
// this could be avoided if only we are using response mapper
|
518
517
|
// for equinox products that exists.
|
519
518
|
// @todo: clean-up
|