@nuskin/ns-product-lib 2.13.1-cx24-51199.1 → 2.13.2-cx24-511910.1

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.13.1-cx24-51199.1",
3
+ "version": "2.13.2-cx24-511910.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": {
@@ -8,8 +8,11 @@ const mapBackOrderDate = require('./backOrderDate');
8
8
  */
9
9
  function childSKUBundle(kits, product) {
10
10
  let sku;
11
- let personalOffer = JSON.parse(sessionStorage.getItem('personalOffer'))
12
- if (personalOffer.active) {
11
+
12
+ let personalOffer = {};
13
+ personalOffer = JSON.parse(sessionStorage.getItem('personalOffer'))
14
+ if (personalOffer !== null && personalOffer.active) {
15
+
13
16
  //get the products with variants selected
14
17
  const productWithVariant = personalOffer.products.filter((sku) => sku.variantSelected !== null)[0]
15
18
  if (productWithVariant !== null) {
@@ -290,9 +290,11 @@ function mapChildSKU(kitBundleProducts, productSku) {
290
290
  if (!kitBundleProducts || !kitBundleProducts.kitProducts) {
291
291
  return [];
292
292
  }
293
- let personalOffer = JSON.parse(sessionStorage.getItem('personalOffer'))
294
293
  let productWithVariant;
295
- if (personalOffer && personalOffer.active) {
294
+ let personalOffer = {};
295
+
296
+ personalOffer = JSON.parse(sessionStorage.getItem('personalOffer'))
297
+ if (personalOffer !== null && personalOffer.active) {
296
298
  productWithVariant = personalOffer.products.filter((sku) =>
297
299
  sku.type === 'bundle' && sku.variantSelected !== null && sku.sku === productSku
298
300
  )