@nuskin/ns-product-lib 2.13.1 → 2.13.2-cx24-511910.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
@@ -7,24 +7,7 @@ const mapBackOrderDate = require('./backOrderDate');
|
|
7
7
|
* @param {import('.').EquinoxNormalProduct} product
|
8
8
|
*/
|
9
9
|
function childSKUBundle(kits, product) {
|
10
|
-
|
11
|
-
let personalOffer = JSON.parse(sessionStorage.getItem('personalOffer'))
|
12
|
-
if (personalOffer.active) {
|
13
|
-
//get the products with variants selected
|
14
|
-
const productWithVariant = personalOffer.products.filter((sku) => sku.variantSelected !== null)[0]
|
15
|
-
if (productWithVariant !== null) {
|
16
|
-
sku = product.sku.filter((sku) => {
|
17
|
-
console.log('Checking sku ' + sku.identifier + ` ` + product.identifier)
|
18
|
-
return sku.identifier === productWithVariant.variantSelected[product.identifier]
|
19
|
-
})[0]
|
20
|
-
}
|
21
|
-
if (!sku) {
|
22
|
-
sku = product.sku.filter(sku => sku.default)[0];
|
23
|
-
}
|
24
|
-
} else {
|
25
|
-
sku = product.sku.filter(sku => sku.default)[0];
|
26
|
-
}
|
27
|
-
|
10
|
+
const sku = product.sku.filter(sku => sku.default)[0];
|
28
11
|
|
29
12
|
if (!sku) {
|
30
13
|
throw Error('Unable to find the default SKU for product ' + product.identifier);
|
package/src/graph-ql/product.js
CHANGED
@@ -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
|
-
|
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
|
)
|