@nuskin/ns-product-lib 2.8.0-cx24-3684.1 → 2.8.0-cx24-3684.3

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ # [2.8.0-cx24-3684.3](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.8.0-cx24-3684.2...v2.8.0-cx24-3684.3) (2023-04-17)
2
+
3
+
4
+ ### Update
5
+
6
+ * fix promotion price (#CX24-3684) ([7a1a2bc](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/7a1a2bcb4d9f05e57c77f71d5a17dec595578e14)), closes [#CX24-3684](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3684)
7
+
8
+ # [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)
9
+
10
+
11
+ ### Update
12
+
13
+ * 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)
14
+ * 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)
15
+
1
16
  # [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
17
 
3
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.8.0-cx24-3684.1",
3
+ "version": "2.8.0-cx24-3684.3",
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": {
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.getPricing(priceType));
265
+ this.setPrice(this.price || this.getPricing(priceType));
266
266
  this.setCv(this.getCvWithType(priceType));
267
267
  this.setPv(this.getPvWithType(priceType));
268
268
  this.priceType = priceType;
@@ -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 ? discountedPrice : eqVariant.priceFacets["Wholesale Price"];
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
- let productTitle = productData.properties.name
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 ? discountedPrice : product.priceFacets["Wholesale Price"];
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": productTitle,
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 (exists) {
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