@nuskin/ns-product-lib 2.7.0-cx24-3702.8 → 2.7.1-cx24-3709.1

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [2.7.1-cx24-3709.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0...v2.7.1-cx24-3709.1) (2023-04-12)
2
+
3
+
4
+ ### Fix
5
+
6
+ * use originalPrice when product has a promotion #CX24-3709 ([b755d1c](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/b755d1c633595389dba3711354d27948e71e98de)), closes [#CX24-3709](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3709)
7
+
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
+
10
+
11
+ ### Update
12
+
13
+ * New variants mapping, Fix add to cart issues, Fix variant issues ([e4ee702](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/e4ee7023a163ed8af1fc6224298f50a03dcfd638))
14
+
1
15
  # [2.7.0-cx24-3702.8](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0-cx24-3702.7...v2.7.0-cx24-3702.8) (2023-04-04)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.7.0-cx24-3702.8",
3
+ "version": "2.7.1-cx24-3709.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": {
@@ -435,7 +435,7 @@ const ProductData = {
435
435
  "RTL": product.priceFacets["Regular Price"],
436
436
  "WADW": product.priceFacets["Wholesale Price"],
437
437
  "WHL": product.priceFacets["Wholesale Price"],
438
- "WWHL": product.priceFacets["Wholesale Price"]
438
+ "WWHL": this.mapWWHL(product)
439
439
  },
440
440
  "cvMap": {
441
441
  "WWHL": productCVPrice,
@@ -510,6 +510,18 @@ const ProductData = {
510
510
  };
511
511
  },
512
512
 
513
+ mapWWHL: function(product) {
514
+ if (
515
+ product.promotion
516
+ && product.promotion.length > 0
517
+ && product.priceFacets["Regular Price"]
518
+ ) {
519
+ return product.priceFacets["Regular Price"];
520
+ }
521
+
522
+ return product.priceFacets["Wholesale Price"];
523
+ },
524
+
513
525
  mapEquinoxSKUExists: function(exists) {
514
526
  // this could be avoided if only we are using response mapper
515
527
  // for equinox products that exists.