@nuskin/ns-product-lib 2.7.1-cx24-3879.2 → 2.8.0-cx24-3705.1

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,17 +1,9 @@
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.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)
2
2
 
3
3
 
4
- ### Fix
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))
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)
9
-
10
-
11
- ### Fix
4
+ ### Update
12
5
 
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))
6
+ * setting correct title if multiple variants ([9574804](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/9574804094f65261ff45c9658ba4e4d4baf0bdf2))
15
7
 
16
8
  # [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
9
 
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.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": {
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,8 @@ 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
375
377
  }
376
378
 
377
379
  const {
@@ -393,7 +395,7 @@ const ProductData = {
393
395
  ...product,
394
396
  "sku": product.identifier,
395
397
  "globalProductID": productData.identifier,
396
- "title": productData.properties.name,
398
+ "title": productTitle,
397
399
  "country": product.properties.market,
398
400
  "language": "en",
399
401
  "shortDescr": productData.properties.description,
@@ -510,7 +512,7 @@ const ProductData = {
510
512
  };
511
513
  },
512
514
 
513
- mapEquinoxSKUExists: function(exists) {
515
+ mapEquinoxSKUExists: function (exists) {
514
516
  // this could be avoided if only we are using response mapper
515
517
  // for equinox products that exists.
516
518
  // @todo: clean-up