@nuskin/ns-product-lib 2.6.1-cx24-3607.4 → 2.6.2-cx24-3563.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +14 -0
- package/package.json +1 -1
- package/src/equinox-helpers/availableQuantity.js +2 -2
- package/src/product.js +6 -0
- package/src/productData.js +2 -1
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
## [2.6.2-cx24-3563.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.1...v2.6.2-cx24-3563.1) (2023-03-18)
|
2
|
+
|
3
|
+
|
4
|
+
### Fix
|
5
|
+
|
6
|
+
* modified childSkus to equinoxChildSkus ([9f42ae5](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/9f42ae5d02b3e1e810bdb289cf6afee1de086a8b))
|
7
|
+
|
8
|
+
## [2.6.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.0...v2.6.1) (2023-03-16)
|
9
|
+
|
10
|
+
|
11
|
+
### Fix
|
12
|
+
|
13
|
+
* (equinox-enabled) skip product mapping when an error occurs in PLP #CX24-3607 ([454eaf3](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/454eaf3b899e27f1feaeda383553eb13dcb8b205)), closes [#CX24-3607](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/issues/CX24-3607)
|
14
|
+
|
1
15
|
## [2.6.1-cx24-3607.4](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.1-cx24-3607.3...v2.6.1-cx24-3607.4) (2023-03-16)
|
2
16
|
|
3
17
|
|
package/package.json
CHANGED
@@ -8,8 +8,8 @@ function availableQuantity(product) {
|
|
8
8
|
return product.inventoryProperties.atpQty;
|
9
9
|
}
|
10
10
|
|
11
|
-
if (product.
|
12
|
-
const quantities = product.
|
11
|
+
if (product.equinoxChildSkus && product.equinoxChildSkus.length > 0) {
|
12
|
+
const quantities = product.equinoxChildSkus
|
13
13
|
.filter(cs => cs.inventory !== undefined)
|
14
14
|
.map(cs => cs.inventory.atpQty);
|
15
15
|
|
package/src/product.js
CHANGED
@@ -76,6 +76,7 @@ const Product = function(productData) {
|
|
76
76
|
//@example "IN STOCK"
|
77
77
|
this.inventory = "";
|
78
78
|
this.equinoxProductId = "";
|
79
|
+
this.equinoxChildSkus = [];
|
79
80
|
|
80
81
|
this.setMarketAttributes = function(productStatus) {
|
81
82
|
if (productStatus.marketAttributes) {
|
@@ -504,6 +505,7 @@ const Product = function(productData) {
|
|
504
505
|
retData.pvMap = this.pvMap;
|
505
506
|
retData.orderTypes = this.orderTypes;
|
506
507
|
retData.childSkus = this.childSkus;
|
508
|
+
retData.equinoxChildSkus = this.equinoxChildSkus;
|
507
509
|
retData.custTypes = this.custTypes;
|
508
510
|
retData.division = this.division;
|
509
511
|
retData.backOrderDate = this.backOrderDate;
|
@@ -675,6 +677,10 @@ const Product = function(productData) {
|
|
675
677
|
}
|
676
678
|
|
677
679
|
this.equinoxProductId = data.equinoxProductId;
|
680
|
+
|
681
|
+
if(data.equinoxChildSkus) {
|
682
|
+
this.equinoxChildSkus = data.equinoxChildSkus;
|
683
|
+
}
|
678
684
|
}
|
679
685
|
};
|
680
686
|
|
package/src/productData.js
CHANGED
@@ -366,7 +366,7 @@ const ProductData = {
|
|
366
366
|
const productPrice = eventName ? defaultProductPrice : product.priceFacets["Regular Price"];
|
367
367
|
const discountedPrice = eventName ? computedPrice : product.priceFacets["Regular Price"];
|
368
368
|
|
369
|
-
product.
|
369
|
+
product.equinoxChildSkus = await this.fetchChildSkus(product);
|
370
370
|
product.availableQuantity = mapAvailableQuantity(product);
|
371
371
|
product = {
|
372
372
|
...product,
|
@@ -427,6 +427,7 @@ const ProductData = {
|
|
427
427
|
"WHL": product.priceFacets.PV
|
428
428
|
},
|
429
429
|
"orderTypes": this._setOrderType(product.properties),
|
430
|
+
"childSkus": [],
|
430
431
|
"custTypes": this.switchCustType(product.properties.customerTypes),
|
431
432
|
"division": productData.properties.division,
|
432
433
|
"backOrderDate": null,
|