@nuskin/product-components 3.18.0-cx24-6773.1 → 3.18.0-td-341.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", {"name":"CX24-6773", "channel":"prerelease", "prerelease":"cx24-6773"}
3
+ "master", {"name":"TD-341", "channel":"prerelease", "prerelease":"td-341"}
4
4
  ],
5
5
  "plugins": [
6
6
  "@semantic-release/release-notes-generator",
@@ -46,7 +46,7 @@
46
46
 
47
47
  <script>
48
48
  import { NsExpressiveLink, NsIcon, NsSpinner } from "@nuskin/design-components";
49
- import { StringService } from "@nuskin/ns-util";
49
+ import { StringService, csStringService } from "@nuskin/ns-util";
50
50
  import { fromJsonString } from "@nuskin/ns-common-lib";
51
51
 
52
52
  import NsProductCard from "./NsProductCard.vue";
@@ -190,9 +190,12 @@ export default {
190
190
  await this.$nextTick();
191
191
 
192
192
  try {
193
- const commonStrings = await StringService.getStrings(
194
- commonStringKeys
195
- );
193
+ let commonStrings = {};
194
+ if (this.$NsProductAppService.useCSResources) {
195
+ commonStrings = await csStringService.getStrings(commonStringKeys);
196
+ } else {
197
+ commonStrings = await StringService.getStrings(commonStringKeys);
198
+ }
196
199
  if (commonStrings && commonStrings.loadMore) {
197
200
  this.loadMoreText = commonStrings.loadMore;
198
201
  }
@@ -772,7 +772,13 @@ export default {
772
772
  : this.products[sku].availableQuantity || 0;
773
773
  const selectedQuantity = this.products[sku].availability
774
774
  .selectedQuantity;
775
-
775
+ if (
776
+ this.products[sku].invalid ||
777
+ this.products[sku].data.availableQuantity <= 0 ||
778
+ !this.products[sku].availability.addToCart
779
+ ) {
780
+ return undefined;
781
+ }
776
782
  if (!this.products[sku].invalid && availableQuantity >= 1) {
777
783
  selectedQuantityArr[
778
784
  this.products[sku].activeSku
@@ -790,18 +796,27 @@ export default {
790
796
  return;
791
797
  }
792
798
 
799
+ let options = {
800
+ add: {
801
+ item: {
802
+ qty: this.totalProductQuantity
803
+ }
804
+ }
805
+ };
806
+
793
807
  let checkoutProducts = [];
794
808
  const equinoxMarketsConfig = getCachedConfiguration("Equinox_Markets");
795
809
  const countryCode = equinoxMarketsConfig.country_code;
796
810
 
797
811
  if (equinoxMarketsConfig.active) {
812
+ window.sessionStorage.setItem("nstoast-allowed", "true");
798
813
  EquinoxCartService.addBundleToEquinoxCart(
799
814
  validSkus,
800
815
  this.products,
801
816
  selectedQuantityArr
802
817
  )
803
818
  .then(() => {
804
- events.publish(events.shop.ADD_TO_CART);
819
+ events.publish(events.shop.ADD_TO_CART, options);
805
820
  })
806
821
  .catch(err => {
807
822
  console.error(`Failed to add ${validSkus} with Error: ${err} `);
@@ -906,6 +921,7 @@ export default {
906
921
 
907
922
  if (
908
923
  availability &&
924
+ availability.addToCart &&
909
925
  Object.keys(this.products[sku].data).length >= 1 &&
910
926
  availableQuantity >= 1
911
927
  ) {
package/docs/CHANGELOG.md CHANGED
@@ -1 +1 @@
1
- # [3.18.0-cx24-6773.1](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.17.0...v3.18.0-cx24-6773.1) (2024-06-11)
1
+ # [3.18.0-td-341.2](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.18.0-td-341.1...v3.18.0-td-341.2) (2024-10-25)