@nuskin/ns-product-lib 2.21.2 → 2.21.3-it-31008.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.21.2",
3
+ "version": "2.21.3-it-31008.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
@@ -451,7 +451,7 @@ const Product = function (productData) {
451
451
  };
452
452
 
453
453
  this.isBase = function () {
454
- return this.sku.substring(2, 4) === "55";
454
+ return this.variantSkus().length > 0;
455
455
  };
456
456
 
457
457
  this.isVariant = function () {
@@ -427,7 +427,7 @@ const ProductData = {
427
427
 
428
428
  if (productData.sku && productData.sku.length > 1) {
429
429
  // exclude base product from variants
430
- productData.sku.filter(v => v.identifier.substring(2, 4) !== "55").map(variant => {
430
+ productData.sku.filter(v => !v.default).map(variant => {
431
431
  variants[variant.identifier] = this.eqProductVariantMapper(variant);
432
432
  return variant;
433
433
  });