@nuskin/ns-product-lib 2.22.0-mdigi-6056.1 → 2.22.0-mdigi-6056.3

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.22.0-mdigi-6056.1",
3
+ "version": "2.22.0-mdigi-6056.3",
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
@@ -18,6 +18,7 @@ const Product = function (productData) {
18
18
  this.addOns = [];
19
19
  this.restrictedMarkets = [];
20
20
  this.productCarouselImages = [];
21
+ this.categories = [];
21
22
  this.locallyProduced = false;
22
23
 
23
24
  //class variables to be used instead of getters/setters
@@ -497,6 +498,7 @@ const Product = function (productData) {
497
498
  retData.sku = this.sku;
498
499
  retData.globalProductID = this.globalProductID;
499
500
  retData.title = this.title;
501
+ retData.categories = this.categories;
500
502
  retData.country = this.country;
501
503
  retData.language = this.lang;
502
504
  retData.shortDescr = this.shortDescr;
@@ -601,6 +603,7 @@ const Product = function (productData) {
601
603
  }
602
604
  this.globalProductID = data.globalProductID || '';
603
605
  this.title = data.title;
606
+ this.categories = data.categories;
604
607
  this.country = data.country;
605
608
  this.lang = data.language;
606
609
  this.shortDescr = data.shortDescr;
@@ -202,6 +202,7 @@ const ProductData = {
202
202
  "sku": eqVariant.identifier,
203
203
  "globalProductID": eqVariant.identifier,
204
204
  "title": eqVariant.properties.name,
205
+ "categories": eqVariant.properties.categories || [],
205
206
  "country": eqVariant.properties.market,
206
207
  "language": "en",
207
208
  "shortDescr": eqVariant.properties.description,
@@ -458,6 +459,7 @@ const ProductData = {
458
459
  "sku": productSku,
459
460
  "globalProductID": productData.identifier,
460
461
  "title": productTitle,
462
+ "categories": productData.properties.categories || product.properties.categories || [],
461
463
  "country": product.properties.market,
462
464
  "language": "en",
463
465
  "shortDescr": productData.properties.description,