@nuskin/ns-product-lib 2.8.0-cx24-3684.1 → 2.8.0-cx24-3684.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/product.js +1 -1
- package/src/productData.js +5 -9
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
# [2.8.0-cx24-3684.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.8.0-cx24-3684.1...v2.8.0-cx24-3684.2) (2023-04-16)
|
2
|
+
|
3
|
+
|
4
|
+
### Update
|
5
|
+
|
6
|
+
* fix promotion price (#CX24-3684) ([2dedc98](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/2dedc985d2107872791406aca8a195e0132a597d)), closes [#CX24-3684](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3684)
|
7
|
+
* fix promotion price (#CX24-3684) ([e289808](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/e2898085b94f901e5225890e90db5679f9c66888)), closes [#CX24-3684](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3684)
|
8
|
+
|
1
9
|
# [2.8.0-cx24-3684.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.2-cx24-3684.1...v2.8.0-cx24-3684.1) (2023-04-16)
|
2
10
|
|
3
11
|
|
package/package.json
CHANGED
package/src/product.js
CHANGED
@@ -262,7 +262,7 @@ const Product = function (productData) {
|
|
262
262
|
|
263
263
|
if (option.isEqPromotion) {
|
264
264
|
//retain product.price as original price
|
265
|
-
this.setPrice(this.
|
265
|
+
this.setPrice(this.price);
|
266
266
|
this.setCv(this.getCvWithType(priceType));
|
267
267
|
this.setPv(this.getPvWithType(priceType));
|
268
268
|
this.priceType = priceType;
|
package/src/productData.js
CHANGED
@@ -140,7 +140,7 @@ 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 ?
|
143
|
+
const wholeSalePrice = eventName ? defaultProductPrice : eqVariant.priceFacets["Wholesale Price"];
|
144
144
|
|
145
145
|
return {
|
146
146
|
"sku": eqVariant.identifier,
|
@@ -365,7 +365,7 @@ const ProductData = {
|
|
365
365
|
let product = (productData.type && productData.type === "kit") ? productData : productData.sku[count];
|
366
366
|
let imageURL = product.properties.imageURL ? product.properties.imageURL : '';
|
367
367
|
let thumbnailImage = imageURL ? imageURL + '?width=40' : ''
|
368
|
-
|
368
|
+
|
369
369
|
|
370
370
|
if (productData.sku && productData.sku.length > 1) {
|
371
371
|
// exclude base product from variants
|
@@ -373,10 +373,6 @@ const ProductData = {
|
|
373
373
|
variants[variant.identifier] = this.eqProductVariantMapper(variant);
|
374
374
|
return variant;
|
375
375
|
});
|
376
|
-
const productArr = productData.sku.filter(p => p.default === true)
|
377
|
-
productTitle = productArr[0].properties.name;
|
378
|
-
product = productArr[0]
|
379
|
-
|
380
376
|
}
|
381
377
|
|
382
378
|
const {
|
@@ -391,7 +387,7 @@ const ProductData = {
|
|
391
387
|
const discountedPrice = eventName ? computedPrice : product.priceFacets["Wholesale Price"];
|
392
388
|
const productCVPrice = eventName ? CVPrice : product.priceFacets.CV;
|
393
389
|
const productPVPrice = eventName ? PVPrice : product.priceFacets.PV;
|
394
|
-
const wholeSalePrice = eventName ?
|
390
|
+
const wholeSalePrice = eventName ? defaultProductPrice : product.priceFacets["Wholesale Price"];
|
395
391
|
|
396
392
|
|
397
393
|
product.childSkus = await this.fetchChildSkus(product);
|
@@ -400,7 +396,7 @@ const ProductData = {
|
|
400
396
|
...product,
|
401
397
|
"sku": product.identifier,
|
402
398
|
"globalProductID": productData.identifier,
|
403
|
-
"title":
|
399
|
+
"title": productData.properties.name,
|
404
400
|
"country": product.properties.market,
|
405
401
|
"language": "en",
|
406
402
|
"shortDescr": productData.properties.description,
|
@@ -517,7 +513,7 @@ const ProductData = {
|
|
517
513
|
};
|
518
514
|
},
|
519
515
|
|
520
|
-
mapEquinoxSKUExists: function
|
516
|
+
mapEquinoxSKUExists: function(exists) {
|
521
517
|
// this could be avoided if only we are using response mapper
|
522
518
|
// for equinox products that exists.
|
523
519
|
// @todo: clean-up
|