@nuskin/ns-product-lib 2.10.0-cx24-4696.1 → 2.10.0-cx24-4696.2

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [2.10.0-cx24-4696.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.10.0-cx24-4696.1...v2.10.0-cx24-4696.2) (2023-07-27)
2
+
3
+
4
+ ### New
5
+
6
+ * Support for bundles ([dce4424](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/dce44249c9edb5ed264ff012ab9ffa6422fe1dca))
7
+
1
8
  # [2.10.0-cx24-4696.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.9.1...v2.10.0-cx24-4696.1) (2023-07-18)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.10.0-cx24-4696.1",
3
+ "version": "2.10.0-cx24-4696.2",
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": {
@@ -325,6 +325,7 @@ const ProductData = {
325
325
  * @returns {obj} promotion
326
326
  */
327
327
  getEqProductPromotions(product) {
328
+ let defaultProductPrice;
328
329
 
329
330
  if (!Array.isArray(product.promotion)) {
330
331
  return {
@@ -334,8 +335,11 @@ const ProductData = {
334
335
  eventName: null
335
336
  }
336
337
  }
337
-
338
- const defaultProductPrice = product.totalValue ? product.totalValue.originalPrice : 0;
338
+ if (product.type === "bundle") {
339
+ defaultProductPrice = product.totalValue ? product.totalValue.priceFacets["Regular Price"] : 0;
340
+ } else {
341
+ defaultProductPrice = product.totalValue ? product.totalValue.originalPrice : 0;
342
+ }
339
343
  const computedPrice = product.totalValue && product.totalValue.priceAfterDiscount
340
344
  ? product.totalValue.priceAfterDiscount
341
345
  : 0;