@nuskin/product-components 3.17.10 → 3.17.11-brw-4218.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/.releaserc +1 -1
- package/docs/CHANGELOG.md +1 -1
- package/gl-sbom-npm-yarn.cdx.json +2 -2
- package/mixins/NsProductMixin.js +17 -44
- package/package.json +2 -2
- package/services/EQPromotionService.js +2 -0
package/.releaserc
CHANGED
package/docs/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
## [3.17.
|
|
1
|
+
## [3.17.11-brw-4218.2](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.17.11-brw-4218.1...v3.17.11-brw-4218.2) (2024-08-27)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bomFormat": "CycloneDX",
|
|
3
3
|
"specVersion": "1.4",
|
|
4
|
-
"serialNumber": "urn:uuid:
|
|
4
|
+
"serialNumber": "urn:uuid:5f05f728-db21-492e-9540-f36c1753fca5",
|
|
5
5
|
"version": 1,
|
|
6
6
|
"metadata": {
|
|
7
|
-
"timestamp": "2024-08-
|
|
7
|
+
"timestamp": "2024-08-27T15:41:10Z",
|
|
8
8
|
"tools": [
|
|
9
9
|
{
|
|
10
10
|
"vendor": "GitLab",
|
package/mixins/NsProductMixin.js
CHANGED
|
@@ -662,7 +662,6 @@ const NsProductMixin = {
|
|
|
662
662
|
);
|
|
663
663
|
})
|
|
664
664
|
.catch(error => {
|
|
665
|
-
this.maxQuantity = 0;
|
|
666
665
|
console.error("Failed to retrieve add to cart quantity.", error);
|
|
667
666
|
})
|
|
668
667
|
.finally(() => {
|
|
@@ -707,9 +706,14 @@ const NsProductMixin = {
|
|
|
707
706
|
let backOrderDate = new Date(this.product.backOrderDate);
|
|
708
707
|
let today = new Date();
|
|
709
708
|
if (backOrderDate < today) {
|
|
710
|
-
this.
|
|
711
|
-
|
|
712
|
-
|
|
709
|
+
if (this.product.availableQuantity > 0) {
|
|
710
|
+
this.statusMessage = "";
|
|
711
|
+
this.statusMessageKey = "releasedForSale";
|
|
712
|
+
} else {
|
|
713
|
+
this.statusMessage = this.localTranslations.outOfStock;
|
|
714
|
+
this.statusMessageKey = "outOfStock";
|
|
715
|
+
this.disable();
|
|
716
|
+
}
|
|
713
717
|
}
|
|
714
718
|
}
|
|
715
719
|
} else {
|
|
@@ -823,22 +827,8 @@ const NsProductMixin = {
|
|
|
823
827
|
* Set product pricing
|
|
824
828
|
*/
|
|
825
829
|
setStandardPricing() {
|
|
826
|
-
const equinoxMarketsConfig = getCachedConfiguration("Equinox_Markets");
|
|
827
|
-
const isGraphQLActive = equinoxMarketsConfig.MySite_graphql_active;
|
|
828
|
-
|
|
829
830
|
// set price and points
|
|
830
831
|
this.originalPrice = this.product.getPricing(PriceType.WRTL);
|
|
831
|
-
|
|
832
|
-
//graphQL adjustments
|
|
833
|
-
if (isGraphQLActive) {
|
|
834
|
-
this.originalPrice =
|
|
835
|
-
this.product.childSkus &&
|
|
836
|
-
this.product.childSkus.length &&
|
|
837
|
-
this.getPriceType() === PriceType.WWHL
|
|
838
|
-
? this.product.getPricing(PriceType.WHL)
|
|
839
|
-
: this.product.getPricing(PriceType.RTL);
|
|
840
|
-
}
|
|
841
|
-
|
|
842
832
|
this.priceType = this.getPriceType();
|
|
843
833
|
this.price = this.product.getPricing(this.priceType);
|
|
844
834
|
this.points = this.product.getPvFixed();
|
|
@@ -890,33 +880,20 @@ const NsProductMixin = {
|
|
|
890
880
|
// set sales event pricing and points
|
|
891
881
|
this.originalPriceType = this.product.priceType;
|
|
892
882
|
|
|
893
|
-
this.originalPrice =
|
|
894
|
-
isEquinoxEnabled && !isGraphQLActive
|
|
895
|
-
? this.product.getPricing(PriceType.WRTL)
|
|
896
|
-
: this.product.getOriginalPrice();
|
|
897
|
-
|
|
898
|
-
//workaround for graphQL active to show original price
|
|
899
883
|
if (isGraphQLActive) {
|
|
900
|
-
this.originalPrice =
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
? this.product.getPricing(PriceType.WHL)
|
|
905
|
-
: this.product.getPricing(PriceType.RTL);
|
|
884
|
+
this.originalPrice = this.product.getPricing(this.originalPriceType);
|
|
885
|
+
this.product.priceType = `${this.eventName}-${this.originalPriceType}`;
|
|
886
|
+
} else {
|
|
887
|
+
this.product.getOriginalPrice();
|
|
906
888
|
}
|
|
907
889
|
|
|
908
890
|
this.priceType = this.product.priceType;
|
|
909
|
-
|
|
910
|
-
this.price = this.product.getPrice();
|
|
891
|
+
this.price = this.product.getPricing(this.priceType);
|
|
911
892
|
|
|
912
893
|
//If EQ market, always show the discounted price if product has promotion
|
|
913
894
|
//Hence, we set the price to member(wholesale / PriceType.WADW) if the price type PriceType.WADR (retail)
|
|
914
895
|
//this is inline with the change in business rules to always show the discounted prices
|
|
915
|
-
if (
|
|
916
|
-
isEquinoxEnabled &&
|
|
917
|
-
!isGraphQLActive &&
|
|
918
|
-
this.getAdrPriceType() == PriceType.WADR
|
|
919
|
-
) {
|
|
896
|
+
if (isGraphQLActive && this.getAdrPriceType() == PriceType.WADR) {
|
|
920
897
|
this.adrPrice = this.product.getPricing(PriceType.WADW);
|
|
921
898
|
}
|
|
922
899
|
|
|
@@ -925,13 +902,9 @@ const NsProductMixin = {
|
|
|
925
902
|
//for product that has promotion
|
|
926
903
|
//set the price to WWHL if this.getPriceType() === WRTL
|
|
927
904
|
//promotion price is set in product.js setPriceAndPvFromType function
|
|
928
|
-
if (
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
this.getPriceType() == PriceType.WRTL
|
|
932
|
-
) {
|
|
933
|
-
this.price = this.product.getPricing(PriceType.WWHL);
|
|
934
|
-
}
|
|
905
|
+
// if (isGraphQLActive && this.getPriceType() == PriceType.WRTL) {
|
|
906
|
+
// this.price = this.product.getPricing(PriceType.WWHL);
|
|
907
|
+
// }
|
|
935
908
|
|
|
936
909
|
if (this.user && this.isDistributor) {
|
|
937
910
|
this.points = this.product.getPvFixed();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuskin/product-components",
|
|
3
|
-
"version": "3.17.
|
|
3
|
+
"version": "3.17.11-brw-4218.2",
|
|
4
4
|
"description": "Nu Skin Product Components",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@nuskin/ns-core-styles": "2.11.2",
|
|
30
30
|
"@nuskin/ns-icon": "^2.12.0",
|
|
31
31
|
"@nuskin/ns-loyalty-web": "1.5.6",
|
|
32
|
-
"@nuskin/ns-product-lib": "2.
|
|
32
|
+
"@nuskin/ns-product-lib": "2.19.0",
|
|
33
33
|
"@nuskin/ns-shop": "7.0.8",
|
|
34
34
|
"@nuskin/product-recommendation": "2.0.1",
|
|
35
35
|
"axios": "1.6.7",
|
|
@@ -41,6 +41,8 @@ const buildPayload = product => {
|
|
|
41
41
|
let personalOffer = sessionStorage.getItem("personalOffer");
|
|
42
42
|
if (personalOffer !== null) {
|
|
43
43
|
personalOffer = JSON.parse(personalOffer);
|
|
44
|
+
} else {
|
|
45
|
+
personalOffer = { products: [] };
|
|
44
46
|
}
|
|
45
47
|
const matchedProduct = personalOffer.products.filter(
|
|
46
48
|
offerProduct => offerProduct.sku === product.sku
|