@nuskin/ns-product-lib 2.13.2-cx24-511910.1 → 2.13.2-cx24-511910.2
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -7,27 +7,7 @@ const mapBackOrderDate = require('./backOrderDate');
|
|
7
7
|
* @param {import('.').EquinoxNormalProduct} product
|
8
8
|
*/
|
9
9
|
function childSKUBundle(kits, product) {
|
10
|
-
|
11
|
-
|
12
|
-
let personalOffer = {};
|
13
|
-
personalOffer = JSON.parse(sessionStorage.getItem('personalOffer'))
|
14
|
-
if (personalOffer !== null && personalOffer.active) {
|
15
|
-
|
16
|
-
//get the products with variants selected
|
17
|
-
const productWithVariant = personalOffer.products.filter((sku) => sku.variantSelected !== null)[0]
|
18
|
-
if (productWithVariant !== null) {
|
19
|
-
sku = product.sku.filter((sku) => {
|
20
|
-
console.log('Checking sku ' + sku.identifier + ` ` + product.identifier)
|
21
|
-
return sku.identifier === productWithVariant.variantSelected[product.identifier]
|
22
|
-
})[0]
|
23
|
-
}
|
24
|
-
if (!sku) {
|
25
|
-
sku = product.sku.filter(sku => sku.default)[0];
|
26
|
-
}
|
27
|
-
} else {
|
28
|
-
sku = product.sku.filter(sku => sku.default)[0];
|
29
|
-
}
|
30
|
-
|
10
|
+
const sku = product.sku.filter(sku => sku.default)[0];
|
31
11
|
|
32
12
|
if (!sku) {
|
33
13
|
throw Error('Unable to find the default SKU for product ' + product.identifier);
|