@nuskin/ns-product-lib 2.6.2-cx24-3563.1 → 2.6.2-cx24-337703.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +2 -2
- package/package.json +2 -2
- package/src/equinox-helpers/availableQuantity.js +2 -2
- package/src/product.js +0 -6
- package/src/productData.js +2 -4
package/CHANGELOG.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
## [2.6.2-cx24-
|
1
|
+
## [2.6.2-cx24-337703.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.1...v2.6.2-cx24-337703.1) (2023-03-22)
|
2
2
|
|
3
3
|
|
4
4
|
### Fix
|
5
5
|
|
6
|
-
*
|
6
|
+
* Show dropdown for variants ([85cdf69](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/85cdf69cc2bbf6700ec5c9bcacc7222cf2ddf674))
|
7
7
|
|
8
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
9
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nuskin/ns-product-lib",
|
3
|
-
"version": "2.6.2-cx24-
|
3
|
+
"version": "2.6.2-cx24-337703.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": {
|
@@ -33,7 +33,7 @@
|
|
33
33
|
"dependencies": {
|
34
34
|
"@nuskin/configuration-sdk": "2.2.3",
|
35
35
|
"@nuskin/ns-common-lib": "1.4.5",
|
36
|
-
"@nuskin/ns-util": "4.2.
|
36
|
+
"@nuskin/ns-util": "4.2.7",
|
37
37
|
"axios": "0.27.2",
|
38
38
|
"qs": "6.11.0"
|
39
39
|
},
|
@@ -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.childSkus && product.childSkus.length > 0) {
|
12
|
+
const quantities = product.childSkus
|
13
13
|
.filter(cs => cs.inventory !== undefined)
|
14
14
|
.map(cs => cs.inventory.atpQty);
|
15
15
|
|
package/src/product.js
CHANGED
@@ -76,7 +76,6 @@ const Product = function(productData) {
|
|
76
76
|
//@example "IN STOCK"
|
77
77
|
this.inventory = "";
|
78
78
|
this.equinoxProductId = "";
|
79
|
-
this.equinoxChildSkus = [];
|
80
79
|
|
81
80
|
this.setMarketAttributes = function(productStatus) {
|
82
81
|
if (productStatus.marketAttributes) {
|
@@ -505,7 +504,6 @@ const Product = function(productData) {
|
|
505
504
|
retData.pvMap = this.pvMap;
|
506
505
|
retData.orderTypes = this.orderTypes;
|
507
506
|
retData.childSkus = this.childSkus;
|
508
|
-
retData.equinoxChildSkus = this.equinoxChildSkus;
|
509
507
|
retData.custTypes = this.custTypes;
|
510
508
|
retData.division = this.division;
|
511
509
|
retData.backOrderDate = this.backOrderDate;
|
@@ -677,10 +675,6 @@ const Product = function(productData) {
|
|
677
675
|
}
|
678
676
|
|
679
677
|
this.equinoxProductId = data.equinoxProductId;
|
680
|
-
|
681
|
-
if(data.equinoxChildSkus) {
|
682
|
-
this.equinoxChildSkus = data.equinoxChildSkus;
|
683
|
-
}
|
684
678
|
}
|
685
679
|
};
|
686
680
|
|
package/src/productData.js
CHANGED
@@ -66,7 +66,6 @@ const ProductData = {
|
|
66
66
|
}
|
67
67
|
|
68
68
|
const filter = skuFilter.join(" OR ")
|
69
|
-
//axios.defaults.withCredentials = true;
|
70
69
|
|
71
70
|
const url = `${config.API_Base_URLs}/orchestrationservices/storefront/catalogs/search/`;
|
72
71
|
const href = `${url}?filter='\\\\''${encodeURI(filter)}'\\''`;
|
@@ -339,11 +338,11 @@ const ProductData = {
|
|
339
338
|
|
340
339
|
eqProductMapper: async function (productDataResponse, skus) {
|
341
340
|
let count = 0;
|
342
|
-
let variants = {};
|
343
341
|
const products = [];
|
344
342
|
|
345
343
|
for (const productData of productDataResponse) {
|
346
344
|
try {
|
345
|
+
let variants = {};
|
347
346
|
let product = (productData.type && productData.type === "kit") ? productData : productData.sku[count];
|
348
347
|
let imageURL = product.properties.imageURL ? product.properties.imageURL : '';
|
349
348
|
let thumbnailImage = imageURL ? imageURL + '?width=40' : ''
|
@@ -366,7 +365,7 @@ const ProductData = {
|
|
366
365
|
const productPrice = eventName ? defaultProductPrice : product.priceFacets["Regular Price"];
|
367
366
|
const discountedPrice = eventName ? computedPrice : product.priceFacets["Regular Price"];
|
368
367
|
|
369
|
-
product.
|
368
|
+
product.childSkus = await this.fetchChildSkus(product);
|
370
369
|
product.availableQuantity = mapAvailableQuantity(product);
|
371
370
|
product = {
|
372
371
|
...product,
|
@@ -427,7 +426,6 @@ const ProductData = {
|
|
427
426
|
"WHL": product.priceFacets.PV
|
428
427
|
},
|
429
428
|
"orderTypes": this._setOrderType(product.properties),
|
430
|
-
"childSkus": [],
|
431
429
|
"custTypes": this.switchCustType(product.properties.customerTypes),
|
432
430
|
"division": productData.properties.division,
|
433
431
|
"backOrderDate": null,
|