@nuskin/ns-product-lib 2.7.1-cx24-3879.2 → 2.8.0-cx24-3705.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +6 -7
- package/package.json +1 -1
- package/src/product.js +1 -5
- package/src/productData.js +7 -3
package/CHANGELOG.md
CHANGED
@@ -1,17 +1,16 @@
|
|
1
|
-
|
1
|
+
# [2.8.0-cx24-3705.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.8.0-cx24-3705.1...v2.8.0-cx24-3705.2) (2023-04-14)
|
2
2
|
|
3
3
|
|
4
|
-
###
|
4
|
+
### Update
|
5
5
|
|
6
|
-
*
|
6
|
+
* setting correct title if multiple variants ([583e74d](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/583e74d41acc7213cd86a48df9076a453da8bb93))
|
7
7
|
|
8
|
-
|
8
|
+
# [2.8.0-cx24-3705.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0...v2.8.0-cx24-3705.1) (2023-04-14)
|
9
9
|
|
10
10
|
|
11
|
-
###
|
11
|
+
### Update
|
12
12
|
|
13
|
-
*
|
14
|
-
* Payload for subscription products are missing when added to cart from MySite homepage ([d49957f](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/d49957f44d9ce6b6469b0bc94bc8f8050d00f35a))
|
13
|
+
* setting correct title if multiple variants ([9574804](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/9574804094f65261ff45c9658ba4e4d4baf0bdf2))
|
15
14
|
|
16
15
|
# [2.7.0](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.2...v2.7.0) (2023-04-05)
|
17
16
|
|
package/package.json
CHANGED
package/src/product.js
CHANGED
@@ -337,11 +337,7 @@ const Product = function (productData) {
|
|
337
337
|
return this.addCvWithType(csvKey, productStatus.csv[csvKey]);
|
338
338
|
}, this);
|
339
339
|
}
|
340
|
-
|
341
|
-
if(this.equinoxProductId == "") {
|
342
|
-
this.orderTypes = ProductUtils.mergeOrderTypes(this.orderTypes, productStatus.orderType);
|
343
|
-
}
|
344
|
-
|
340
|
+
this.orderTypes = ProductUtils.mergeOrderTypes(this.orderTypes, productStatus.orderType);
|
345
341
|
if (productStatus.childSkus) {
|
346
342
|
this.childSkus = productStatus.childSkus;
|
347
343
|
}
|
package/src/productData.js
CHANGED
@@ -364,7 +364,7 @@ const ProductData = {
|
|
364
364
|
let product = (productData.type && productData.type === "kit") ? productData : productData.sku[count];
|
365
365
|
let imageURL = product.properties.imageURL ? product.properties.imageURL : '';
|
366
366
|
let thumbnailImage = imageURL ? imageURL + '?width=40' : ''
|
367
|
-
|
367
|
+
let productTitle = productData.properties.name
|
368
368
|
|
369
369
|
if (productData.sku && productData.sku.length > 1) {
|
370
370
|
// exclude base product from variants
|
@@ -372,6 +372,10 @@ const ProductData = {
|
|
372
372
|
variants[variant.identifier] = this.eqProductVariantMapper(variant);
|
373
373
|
return variant;
|
374
374
|
});
|
375
|
+
const productArr = productData.sku.filter(p => p.default === true)
|
376
|
+
productTitle = productArr[0].properties.name;
|
377
|
+
product = productArr[0]
|
378
|
+
|
375
379
|
}
|
376
380
|
|
377
381
|
const {
|
@@ -393,7 +397,7 @@ const ProductData = {
|
|
393
397
|
...product,
|
394
398
|
"sku": product.identifier,
|
395
399
|
"globalProductID": productData.identifier,
|
396
|
-
"title":
|
400
|
+
"title": productTitle,
|
397
401
|
"country": product.properties.market,
|
398
402
|
"language": "en",
|
399
403
|
"shortDescr": productData.properties.description,
|
@@ -510,7 +514,7 @@ const ProductData = {
|
|
510
514
|
};
|
511
515
|
},
|
512
516
|
|
513
|
-
mapEquinoxSKUExists: function(exists) {
|
517
|
+
mapEquinoxSKUExists: function (exists) {
|
514
518
|
// this could be avoided if only we are using response mapper
|
515
519
|
// for equinox products that exists.
|
516
520
|
// @todo: clean-up
|