@nuskin/ns-product-lib 2.13.0-cx24-100723.1 → 2.13.0-cx24-100723.3

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ # [2.13.0-cx24-100723.3](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.13.0-cx24-100723.2...v2.13.0-cx24-100723.3) (2023-10-10)
2
+
3
+
4
+ ### New
5
+
6
+ * Handle adding variants from bundle ([cc8f8e0](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/cc8f8e04d44d6a84894122a7e63cd72b48b724b0))
7
+
8
+ # [2.13.0-cx24-100723.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.13.0-cx24-100723.1...v2.13.0-cx24-100723.2) (2023-10-07)
9
+
10
+
11
+ ### New
12
+
13
+ * Handle adding variants from bundle ([a6ae5ac](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/a6ae5ac1f1e5c3b68c11f54a22d9db000f6222d3))
14
+ * Handle adding variants from bundle ([8499d68](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/8499d6818cfbd2526da23dea42fd89e288d52ff3))
15
+
1
16
  # [2.13.0-cx24-100723.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.12.0...v2.13.0-cx24-100723.1) (2023-10-07)
2
17
 
3
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.13.0-cx24-100723.1",
3
+ "version": "2.13.0-cx24-100723.3",
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": {
@@ -11,7 +11,12 @@ function childSKUBundle(kits, product, identifier) {
11
11
  let sku;
12
12
  let personalOffer = sessionStorage.getItem('personalOffer')
13
13
  if (personalOffer.active) {
14
- sku = personalOffer.products.map(product => product.sku == identifier)
14
+ const skuAdd = personalOffer.products.filter((p) => {
15
+ return p.sku === identifier
16
+ })[0]
17
+ sku = product.sku.filter((sku) => {
18
+ return sku.identifier == skuAdd.variantSelected[product.identifier]
19
+ })[0]
15
20
  } else {
16
21
  sku = product.sku.filter(sku => sku.default)[0];
17
22
  }