@nuskin/ns-product-lib 2.8.0 → 2.8.1-cx24-4061.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/productData.js +9 -5
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## [2.8.1-cx24-4061.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.8.0...v2.8.1-cx24-4061.1) (2023-05-09)
|
2
|
+
|
3
|
+
|
4
|
+
### Fix
|
5
|
+
|
6
|
+
* Multiple variants add to cart not adding correct sku ([1c20e6e](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/1c20e6e394ed9bf680be2cd7a2f500d83288b87a))
|
7
|
+
|
1
8
|
# [2.8.0](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.1...v2.8.0) (2023-05-02)
|
2
9
|
|
3
10
|
|
package/package.json
CHANGED
package/src/productData.js
CHANGED
@@ -364,8 +364,9 @@ const ProductData = {
|
|
364
364
|
let variants = {};
|
365
365
|
let product = (productData.type && productData.type === "kit") ? productData : productData.sku[count];
|
366
366
|
let imageURL = product.properties.imageURL ? product.properties.imageURL : '';
|
367
|
-
let thumbnailImage = imageURL ? imageURL + '?width=40' : ''
|
368
|
-
|
367
|
+
let thumbnailImage = imageURL ? imageURL + '?width=40' : '';
|
368
|
+
let productTitle = productData.properties.name;
|
369
|
+
let productSku = product.identifier
|
369
370
|
|
370
371
|
if (productData.sku && productData.sku.length > 1) {
|
371
372
|
// exclude base product from variants
|
@@ -373,6 +374,9 @@ const ProductData = {
|
|
373
374
|
variants[variant.identifier] = this.eqProductVariantMapper(variant);
|
374
375
|
return variant;
|
375
376
|
});
|
377
|
+
const productArr = productData.sku.filter(p => p.default === true)
|
378
|
+
productTitle = productArr[0].properties.name;
|
379
|
+
productSku = productArr[0].identifier
|
376
380
|
}
|
377
381
|
|
378
382
|
const {
|
@@ -394,9 +398,9 @@ const ProductData = {
|
|
394
398
|
product.availableQuantity = mapAvailableQuantity(product);
|
395
399
|
product = {
|
396
400
|
...product,
|
397
|
-
"sku":
|
401
|
+
"sku": productSku,
|
398
402
|
"globalProductID": productData.identifier,
|
399
|
-
"title":
|
403
|
+
"title": productTitle,
|
400
404
|
"country": product.properties.market,
|
401
405
|
"language": "en",
|
402
406
|
"shortDescr": productData.properties.description,
|
@@ -513,7 +517,7 @@ const ProductData = {
|
|
513
517
|
};
|
514
518
|
},
|
515
519
|
|
516
|
-
mapEquinoxSKUExists: function(exists) {
|
520
|
+
mapEquinoxSKUExists: function (exists) {
|
517
521
|
// this could be avoided if only we are using response mapper
|
518
522
|
// for equinox products that exists.
|
519
523
|
// @todo: clean-up
|