@nuskin/product-components 3.17.12-cx24-7022.4 → 3.17.13-brw-4218.1
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/.releaserc +1 -1
- package/docs/CHANGELOG.md +1 -1
- package/gl-sbom-npm-yarn.cdx.json +2 -2
- package/mixins/NsProductMixin.js +22 -5
- package/package.json +1 -1
package/.releaserc
CHANGED
package/docs/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
## [3.17.
|
|
1
|
+
## [3.17.13-brw-4218.1](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.17.12...v3.17.13-brw-4218.1) (2024-09-03)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bomFormat": "CycloneDX",
|
|
3
3
|
"specVersion": "1.4",
|
|
4
|
-
"serialNumber": "urn:uuid:
|
|
4
|
+
"serialNumber": "urn:uuid:ce4d63cf-0e6a-4d8b-b264-5e2a9ca28233",
|
|
5
5
|
"version": 1,
|
|
6
6
|
"metadata": {
|
|
7
|
-
"timestamp": "2024-09-
|
|
7
|
+
"timestamp": "2024-09-03T16:02:59Z",
|
|
8
8
|
"tools": [
|
|
9
9
|
{
|
|
10
10
|
"vendor": "GitLab",
|
package/mixins/NsProductMixin.js
CHANGED
|
@@ -246,7 +246,11 @@ const NsProductMixin = {
|
|
|
246
246
|
return this.$NsProductUserService.isPreferredCustomer;
|
|
247
247
|
},
|
|
248
248
|
isWholesale() {
|
|
249
|
-
|
|
249
|
+
if (this.$NsProductUserService.isLoggedIn) {
|
|
250
|
+
return this.$NsProductUserService.isUserWholesale;
|
|
251
|
+
} else {
|
|
252
|
+
return this.$NsProductUserService.isWholesale;
|
|
253
|
+
}
|
|
250
254
|
},
|
|
251
255
|
loyaltyStatusAndLinks() {
|
|
252
256
|
return this.marketConfig.loyalty || {};
|
|
@@ -657,11 +661,11 @@ const NsProductMixin = {
|
|
|
657
661
|
// WARNING: this.product is volatile here. re-check is using this.product.
|
|
658
662
|
this.maxQuantity = Math.min(
|
|
659
663
|
shopProduct.maxQuantity,
|
|
660
|
-
shopProduct.availableQuantity,
|
|
661
664
|
productQuantity
|
|
662
665
|
);
|
|
663
666
|
})
|
|
664
667
|
.catch(error => {
|
|
668
|
+
this.maxQuantity = shopProduct.maxQuantity;
|
|
665
669
|
console.error("Failed to retrieve add to cart quantity.", error);
|
|
666
670
|
})
|
|
667
671
|
.finally(() => {
|
|
@@ -706,9 +710,14 @@ const NsProductMixin = {
|
|
|
706
710
|
let backOrderDate = new Date(this.product.backOrderDate);
|
|
707
711
|
let today = new Date();
|
|
708
712
|
if (backOrderDate < today) {
|
|
709
|
-
this.
|
|
710
|
-
|
|
711
|
-
|
|
713
|
+
if (this.product.availableQuantity > 0) {
|
|
714
|
+
this.statusMessage = "";
|
|
715
|
+
this.statusMessageKey = "releasedForSale";
|
|
716
|
+
} else {
|
|
717
|
+
this.statusMessage = this.localTranslations.outOfStock;
|
|
718
|
+
this.statusMessageKey = "outOfStock";
|
|
719
|
+
this.disable();
|
|
720
|
+
}
|
|
712
721
|
}
|
|
713
722
|
}
|
|
714
723
|
} else {
|
|
@@ -1118,6 +1127,14 @@ const NsProductMixin = {
|
|
|
1118
1127
|
productToAdd.equinoxProductId = productIdentifier;
|
|
1119
1128
|
//productToAdd.properties = productData.products[0].properties
|
|
1120
1129
|
}
|
|
1130
|
+
if (
|
|
1131
|
+
productToAdd.backOrderDate &&
|
|
1132
|
+
new Date(productToAdd.backOrderDate) > new Date()
|
|
1133
|
+
) {
|
|
1134
|
+
productToAdd.inventory = "BACKORDER";
|
|
1135
|
+
productToAdd.properties.isBackOrdered = true;
|
|
1136
|
+
productToAdd.properties.inventoryStatus = "BACKORDER";
|
|
1137
|
+
}
|
|
1121
1138
|
options.product = new ShopProduct(productToAdd);
|
|
1122
1139
|
options.add = {
|
|
1123
1140
|
item: {
|