@nuskin/ns-product-lib 2.5.0-cx24-2179.2.6 → 2.5.0-cx24-2179.2.8

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.5.0-cx24-2179.2.8](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.0-cx24-2179.2.7...v2.5.0-cx24-2179.2.8) (2022-12-06)
2
+
3
+
4
+ ### Fix
5
+
6
+ * event pricing and name (#CX24-2179) ([04a9ce6](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/04a9ce6389988676a0634308ad964bee5c0aa4ab)), closes [#CX24-2179](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-2179)
7
+
8
+ # [2.5.0-cx24-2179.2.7](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.0-cx24-2179.2.6...v2.5.0-cx24-2179.2.7) (2022-12-05)
9
+
10
+
11
+ ### New
12
+
13
+ * added eq promoion bypass for setPriceAndPvFromType v5 (#CX24-2179) ([f5b62e5](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/f5b62e5e82f1830d4105ffc965b64e9a7fc88d9b)), closes [#CX24-2179](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-2179)
14
+
1
15
  # [2.5.0-cx24-2179.2.6](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.0-cx24-2179.2.5...v2.5.0-cx24-2179.2.6) (2022-12-05)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.5.0-cx24-2179.2.6",
3
+ "version": "2.5.0-cx24-2179.2.8",
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
@@ -232,7 +232,6 @@ const Product = function(productData) {
232
232
  // : (_priceType ? _priceType : this.priceType),
233
233
  const priceType = _priceType ? _priceType : this.priceType;
234
234
  const eventPricing = getEventPricing(this, priceType, _activeEvents);
235
- console.log({context: 'NsProductLib.setPriceAndPvFromType', eventPricing: eventPricing});
236
235
 
237
236
  let changed = false;
238
237
  if ((
@@ -109,7 +109,7 @@ const ProductData = {
109
109
 
110
110
  const { eventName, eventLabels, computedPrice, defaultProductPrice} = this.getEqProductPromotions(eqVariant);
111
111
  const productPrice = eventName ? defaultProductPrice : eqVariant.priceFacets["Regular Price"];
112
- const wrtlPrice = eventName ? computedPrice : eqVariant.priceFacets["Regular Price"];
112
+ const discountedPrice = eventName ? computedPrice : eqVariant.priceFacets["Regular Price"];
113
113
 
114
114
  return {
115
115
  "sku": eqVariant.identifier,
@@ -149,9 +149,9 @@ const ProductData = {
149
149
  "cv": (eqVariant.priceFacets.CV) ? eqVariant.priceFacets.CV : '',
150
150
  "pv":eqVariant.priceFacets.PV,
151
151
  "priceType": "WRTL",
152
- "price": productPrice,
152
+ "price": discountedPrice,
153
153
  "priceMap": {
154
- "WRTL": wrtlPrice,
154
+ "WRTL": productPrice,
155
155
  "WADW-WRTL": eqVariant.priceFacets["Regular Price"],
156
156
  "WADR": eqVariant.priceFacets["Regular Price"],
157
157
  "RTL": eqVariant.priceFacets["Regular Price"],
@@ -263,7 +263,7 @@ const ProductData = {
263
263
 
264
264
  const { eventName, eventLabels, computedPrice, defaultProductPrice} = this.getEqProductPromotions(data.sku[count]);
265
265
  const productPrice = eventName ? defaultProductPrice : data.sku[count].priceFacets["Regular Price"];
266
- const wrtlPrice = eventName ? computedPrice : data.sku[count].priceFacets["Regular Price"];
266
+ const discountedPrice = eventName ? computedPrice : data.sku[count].priceFacets["Regular Price"];
267
267
 
268
268
  prod = {
269
269
  "sku": data.sku[count].identifier,
@@ -303,9 +303,9 @@ const ProductData = {
303
303
  "cv": (data.sku[count].priceFacets.CV) ? data.sku[count].priceFacets.CV : '',
304
304
  "pv": data.sku[count].priceFacets.PV,
305
305
  "priceType": "WRTL",
306
- "price": productPrice,
306
+ "price": discountedPrice,
307
307
  "priceMap": {
308
- "WRTL": wrtlPrice,
308
+ "WRTL": productPrice,
309
309
  "WADW-WRTL": data.sku[count].priceFacets["Regular Price"],
310
310
  "WADR": data.sku[count].priceFacets["Regular Price"],
311
311
  "RTL": data.sku[count].priceFacets["Regular Price"],
@@ -363,7 +363,6 @@ const ProductData = {
363
363
  return newProduct
364
364
  });
365
365
 
366
- console.log({context: "NsProductLib.eqProductMapper", product: prodArr});
367
366
  let data = {
368
367
  products: this._sortProductsBySku(skus, prodArr),
369
368
  count: productDataResponse.length