@nuskin/ns-product-lib 2.5.1-cx24-3282m.1 → 2.5.1-cx24-3377.1

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,9 +1,9 @@
1
- ## [2.5.1-cx24-3282m.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.0...v2.5.1-cx24-3282m.1) (2023-02-28)
1
+ ## [2.5.1-cx24-3377.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.0...v2.5.1-cx24-3377.1) (2023-03-02)
2
2
 
3
3
 
4
4
  ### Fix
5
5
 
6
- * Do not set availability from status service if eq ([545ec0e](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/545ec0e4abe500842cc0631ba2d9b33dd8bee86f))
6
+ * Multiple variants not loading properly ([0462248](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/04622485384522e90e843cc77d686692331bfa36))
7
7
 
8
8
  # [2.5.0](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.4.1...v2.5.0) (2023-02-22)
9
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.5.1-cx24-3282m.1",
3
+ "version": "2.5.1-cx24-3377.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
@@ -303,9 +303,7 @@ const Product = function (productData) {
303
303
  if (productStatusSku === this.sku) {
304
304
  this.globalProductID = productStatus.globalProductID;
305
305
  this.status = productStatus.status;
306
- if (!option.isEqPromotion) {
307
- this.availableQuantity = productStatus.availableQuantity;
308
- }
306
+ this.availableQuantity = productStatus.availableQuantity;
309
307
  this.maxQuantity = productStatus.maxQuantity || 999;
310
308
  this.locallyProduced = productStatus.locallyProduced || false;
311
309
  if (productStatus.backordered) {
@@ -429,7 +427,11 @@ const Product = function (productData) {
429
427
  return this.custTypes.includes("30");
430
428
  };
431
429
 
432
- this.isBase = function () {
430
+ this.isBase = function (option = {}) {
431
+ if (option && option.isEquinoxEnabled) {
432
+ return !!this.variants;
433
+ }
434
+
433
435
  return this.sku.substring(2, 4) === "55";
434
436
  };
435
437