@nuskin/product-components 3.2.1 → 3.2.2-cx24-3504.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "branches": [
3
- "master"
3
+ "master", {"name":"CX24-3504", "channel":"prerelease", "prerelease":"cx24-3504"}
4
4
  ],
5
5
  "plugins": [
6
6
  "@semantic-release/npm",
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## [3.2.2-cx24-3504.2](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.2.2-cx24-3504.1...v3.2.2-cx24-3504.2) (2023-03-13)
2
+
3
+
4
+ ### Fix
5
+
6
+ * adr button for equinox ([ffb452a](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/ffb452af972bbe4f2f90eac8fecc7132cae221e5))
7
+ * adr button for equinox ([e12a0bc](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/e12a0bc537d8050df7cff8f3e7644fd167ba1665))
8
+
9
+ ## [3.2.2-cx24-3504.1](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.2.1...v3.2.2-cx24-3504.1) (2023-03-12)
10
+
11
+
12
+ ### Fix
13
+
14
+ * adr button for equinox ([4d425f0](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/4d425f00d6d0ad1d39c5e32f5f987155c2416eed))
15
+
1
16
  ## [3.2.1](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.2.0...v3.2.1) (2023-03-08)
2
17
 
3
18
 
@@ -962,24 +962,48 @@ const NsProductMixin = {
962
962
  */
963
963
  handleAddToAdr() {
964
964
  if (!this.disableAddToAdr) {
965
- let options = {
966
- sku: this.activeSku,
967
- qty: this.selectedQuantity,
968
- adr: !AdrService.isAdrOverride(),
969
- product: this.product,
970
- referrer: this.referrer
971
- };
972
- CartService.addProductToCart(options)
973
- .then(() => {
974
- this.maxQuantity -= options.qty;
975
- this.setStatus();
976
- events.publish(events.shop.ADD_TO_CART, options);
977
- events.publish(events.shop.SHOW_ADD_TO_BAG, options);
978
- this.$emit("added-to-adr", options);
979
- })
980
- .catch(error => {
981
- console.error("Failed to add to ADR.", error);
982
- });
965
+ getConfiguration(["Equinox_Markets"]).then(config => {
966
+ let options = {
967
+ sku: this.activeSku,
968
+ qty: this.selectedQuantity,
969
+ adr: !AdrService.isAdrOverride(),
970
+ referrer: this.referrer
971
+ };
972
+ if (
973
+ config.Equinox_Markets.active &&
974
+ equinoxLocalStorage.isEquinoxEnabled()
975
+ ) {
976
+ ProductDataService.getProductData(this.activeSku).then(
977
+ productData => {
978
+ options.product = new ShopProduct(productData.products[0]);
979
+
980
+ EquinoxCartService.addProductToEquinoxCart(options)
981
+ .then(() => {
982
+ this.maxQuantity -= options.qty;
983
+ this.setStatus();
984
+ events.publish(events.shop.ADD_TO_CART, options);
985
+ events.publish(events.shop.SHOW_ADD_TO_BAG, options);
986
+ this.$emit("added-to-adr", options);
987
+ })
988
+ .catch(error => {
989
+ console.error("Failed to add to ADR.", error);
990
+ });
991
+ }
992
+ );
993
+ } else {
994
+ CartService.addProductToCart(options)
995
+ .then(() => {
996
+ this.maxQuantity -= options.qty;
997
+ this.setStatus();
998
+ events.publish(events.shop.ADD_TO_CART, options);
999
+ events.publish(events.shop.SHOW_ADD_TO_BAG, options);
1000
+ this.$emit("added-to-adr", options);
1001
+ })
1002
+ .catch(error => {
1003
+ console.error("Failed to add to ADR.", error);
1004
+ });
1005
+ }
1006
+ });
983
1007
  }
984
1008
  },
985
1009
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/product-components",
3
- "version": "3.2.1",
3
+ "version": "3.2.2-cx24-3504.2",
4
4
  "description": "Nu Skin Product Components",
5
5
  "main": "index.js",
6
6
  "scripts": {