@nuskin/product-components 3.17.10 → 3.17.11

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/docs/CHANGELOG.md CHANGED
@@ -1 +1 @@
1
- ## [3.17.10](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.17.9...v3.17.10) (2024-08-20)
1
+ ## [3.17.11](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.17.10...v3.17.11) (2024-08-22)
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "bomFormat": "CycloneDX",
3
3
  "specVersion": "1.4",
4
- "serialNumber": "urn:uuid:3baa2328-b254-445f-a19b-a25fc1e6acf1",
4
+ "serialNumber": "urn:uuid:9cc5144a-9548-4485-b27b-466c1afa6324",
5
5
  "version": 1,
6
6
  "metadata": {
7
- "timestamp": "2024-08-20T17:57:35Z",
7
+ "timestamp": "2024-08-22T19:37:18Z",
8
8
  "tools": [
9
9
  {
10
10
  "vendor": "GitLab",
@@ -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(() => {
@@ -823,22 +822,8 @@ const NsProductMixin = {
823
822
  * Set product pricing
824
823
  */
825
824
  setStandardPricing() {
826
- const equinoxMarketsConfig = getCachedConfiguration("Equinox_Markets");
827
- const isGraphQLActive = equinoxMarketsConfig.MySite_graphql_active;
828
-
829
825
  // set price and points
830
826
  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
827
  this.priceType = this.getPriceType();
843
828
  this.price = this.product.getPricing(this.priceType);
844
829
  this.points = this.product.getPvFixed();
@@ -890,33 +875,20 @@ const NsProductMixin = {
890
875
  // set sales event pricing and points
891
876
  this.originalPriceType = this.product.priceType;
892
877
 
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
878
  if (isGraphQLActive) {
900
- this.originalPrice =
901
- this.product.childSkus &&
902
- this.product.childSkus.length &&
903
- this.getPriceType() === PriceType.WWHL
904
- ? this.product.getPricing(PriceType.WHL)
905
- : this.product.getPricing(PriceType.RTL);
879
+ this.originalPrice = this.product.getPricing(this.originalPriceType);
880
+ this.product.priceType = `${this.eventName}-${this.originalPriceType}`;
881
+ } else {
882
+ this.product.getOriginalPrice();
906
883
  }
907
884
 
908
885
  this.priceType = this.product.priceType;
909
-
910
- this.price = this.product.getPrice();
886
+ this.price = this.product.getPricing(this.priceType);
911
887
 
912
888
  //If EQ market, always show the discounted price if product has promotion
913
889
  //Hence, we set the price to member(wholesale / PriceType.WADW) if the price type PriceType.WADR (retail)
914
890
  //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
- ) {
891
+ if (isGraphQLActive && this.getAdrPriceType() == PriceType.WADR) {
920
892
  this.adrPrice = this.product.getPricing(PriceType.WADW);
921
893
  }
922
894
 
@@ -925,13 +897,9 @@ const NsProductMixin = {
925
897
  //for product that has promotion
926
898
  //set the price to WWHL if this.getPriceType() === WRTL
927
899
  //promotion price is set in product.js setPriceAndPvFromType function
928
- if (
929
- isEquinoxEnabled &&
930
- !isGraphQLActive &&
931
- this.getPriceType() == PriceType.WRTL
932
- ) {
933
- this.price = this.product.getPricing(PriceType.WWHL);
934
- }
900
+ // if (isGraphQLActive && this.getPriceType() == PriceType.WRTL) {
901
+ // this.price = this.product.getPricing(PriceType.WWHL);
902
+ // }
935
903
 
936
904
  if (this.user && this.isDistributor) {
937
905
  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.10",
3
+ "version": "3.17.11",
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.18.0",
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