@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 CHANGED
@@ -1,17 +1,16 @@
1
- ## [2.7.1-cx24-3879.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.1-cx24-3879.1...v2.7.1-cx24-3879.2) (2023-04-13)
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
- ### Fix
4
+ ### Update
5
5
 
6
- * Payload for subscription products are missing when added to cart from MySite homepage ([20b0ed2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/20b0ed2661b4d213147cef9e77d268b167b49421))
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
- ## [2.7.1-cx24-3879.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.7.0...v2.7.1-cx24-3879.1) (2023-04-13)
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
- ### Fix
11
+ ### Update
12
12
 
13
- * Payload for subscription products are missing when added to cart from MySite homepage ([7b7ac3b](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/7b7ac3bd7c0b196aa9a7e97e885f7e296ef7e97d))
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.7.1-cx24-3879.2",
3
+ "version": "2.8.0-cx24-3705.2",
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": {
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
- //only remap the orderTypes for legacy (which we'll know when equinoxProductId is blank)
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
  }
@@ -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": productData.properties.name,
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