@pelcro/react-pelcro-js 4.0.0-alpha.119 → 4.0.0-alpha.120

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/dist/index.cjs.js CHANGED
@@ -9206,13 +9206,20 @@ class PelcroActions {
9206
9206
  console.error("invalid item SKU id");
9207
9207
  return false;
9208
9208
  }
9209
- const skusMatchingUserCurrency = window.Pelcro.ecommerce.products.getSkus();
9210
- const itemMatchesUserCurrency = skusMatchingUserCurrency.some(sku => sku.id === quickPurchaseItem.id);
9211
- if (!itemMatchesUserCurrency) {
9212
- const userCurrency = window.Pelcro.user.read().currency;
9213
- console.error(`SKU currency (${quickPurchaseItem.currency}) doesn't match user account's currency (${userCurrency}). users can only purchase SKUs that match their account's currency`);
9214
- return false;
9215
- }
9209
+ window.Pelcro.ecommerce.products.getSkus();
9210
+
9211
+ // const itemMatchesUserCurrency = skusMatchingUserCurrency.some(
9212
+ // (sku) => sku.id === quickPurchaseItem.id
9213
+ // );
9214
+
9215
+ // if (!itemMatchesUserCurrency) {
9216
+ // const userCurrency = window.Pelcro.user.read().currency;
9217
+ // console.error(
9218
+ // `SKU currency (${quickPurchaseItem.currency}) doesn't match user account's currency (${userCurrency}). users can only purchase SKUs that match their account's currency`
9219
+ // );
9220
+ // return false;
9221
+ // }
9222
+
9216
9223
  const quickPurchaseItemWithQuantity = {
9217
9224
  ...quickPurchaseItem,
9218
9225
  quantity: 1
@@ -11403,16 +11410,18 @@ const init$1 = () => {
11403
11410
  if (!quickPurchaseItem) {
11404
11411
  return console.error("invalid item SKU id");
11405
11412
  }
11406
- const purchaseResult = purchaseItem(itemSkuId);
11407
- const itemDidntMatchUserCurrency = purchaseResult === false;
11408
- if (itemDidntMatchUserCurrency) {
11409
- var _window$Pelcro$user$r;
11410
- const userCurrency = (_window$Pelcro$user$r = window.Pelcro.user.read().currency) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.toUpperCase();
11411
- const errorMsg = i18next.t("shop:messages.currencyMismatch", {
11412
- currency: userCurrency
11413
- });
11414
- notify.error(errorMsg);
11415
- }
11413
+ purchaseItem(itemSkuId);
11414
+
11415
+ // if (itemDidntMatchUserCurrency) {
11416
+ // const userCurrency = window.Pelcro.user
11417
+ // .read()
11418
+ // .currency?.toUpperCase();
11419
+ // const errorMsg = i18n.t(
11420
+ // "shop:messages.currencyMismatch",
11421
+ // { currency: userCurrency }
11422
+ // );
11423
+ // notify.error(errorMsg);
11424
+ // }
11416
11425
  });
11417
11426
  }
11418
11427
  }
@@ -56491,24 +56500,6 @@ const CartContainer = ({
56491
56500
  content: t("messages.multipleCurrencies")
56492
56501
  }
56493
56502
  });
56494
- } else {
56495
- const userCurrency = window.Pelcro.user.read().currency;
56496
- const itemsCurrency = cartItems[0].currency;
56497
- if (userCurrency && userCurrency !== itemsCurrency) {
56498
- dispatch({
56499
- type: DISABLE_SUBMIT,
56500
- payload: true
56501
- });
56502
- dispatch({
56503
- type: SHOW_ALERT,
56504
- payload: {
56505
- type: "error",
56506
- content: t("messages.currencyMismatch", {
56507
- currency: userCurrency.toUpperCase()
56508
- })
56509
- }
56510
- });
56511
- }
56512
56503
  }
56513
56504
  }, [cartItems]);
56514
56505
  const submit = (state, dispatch) => {
package/dist/index.esm.js CHANGED
@@ -9164,13 +9164,20 @@ class PelcroActions {
9164
9164
  console.error("invalid item SKU id");
9165
9165
  return false;
9166
9166
  }
9167
- const skusMatchingUserCurrency = window.Pelcro.ecommerce.products.getSkus();
9168
- const itemMatchesUserCurrency = skusMatchingUserCurrency.some(sku => sku.id === quickPurchaseItem.id);
9169
- if (!itemMatchesUserCurrency) {
9170
- const userCurrency = window.Pelcro.user.read().currency;
9171
- console.error(`SKU currency (${quickPurchaseItem.currency}) doesn't match user account's currency (${userCurrency}). users can only purchase SKUs that match their account's currency`);
9172
- return false;
9173
- }
9167
+ window.Pelcro.ecommerce.products.getSkus();
9168
+
9169
+ // const itemMatchesUserCurrency = skusMatchingUserCurrency.some(
9170
+ // (sku) => sku.id === quickPurchaseItem.id
9171
+ // );
9172
+
9173
+ // if (!itemMatchesUserCurrency) {
9174
+ // const userCurrency = window.Pelcro.user.read().currency;
9175
+ // console.error(
9176
+ // `SKU currency (${quickPurchaseItem.currency}) doesn't match user account's currency (${userCurrency}). users can only purchase SKUs that match their account's currency`
9177
+ // );
9178
+ // return false;
9179
+ // }
9180
+
9174
9181
  const quickPurchaseItemWithQuantity = {
9175
9182
  ...quickPurchaseItem,
9176
9183
  quantity: 1
@@ -11361,16 +11368,18 @@ const init$1 = () => {
11361
11368
  if (!quickPurchaseItem) {
11362
11369
  return console.error("invalid item SKU id");
11363
11370
  }
11364
- const purchaseResult = purchaseItem(itemSkuId);
11365
- const itemDidntMatchUserCurrency = purchaseResult === false;
11366
- if (itemDidntMatchUserCurrency) {
11367
- var _window$Pelcro$user$r;
11368
- const userCurrency = (_window$Pelcro$user$r = window.Pelcro.user.read().currency) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.toUpperCase();
11369
- const errorMsg = i18next.t("shop:messages.currencyMismatch", {
11370
- currency: userCurrency
11371
- });
11372
- notify.error(errorMsg);
11373
- }
11371
+ purchaseItem(itemSkuId);
11372
+
11373
+ // if (itemDidntMatchUserCurrency) {
11374
+ // const userCurrency = window.Pelcro.user
11375
+ // .read()
11376
+ // .currency?.toUpperCase();
11377
+ // const errorMsg = i18n.t(
11378
+ // "shop:messages.currencyMismatch",
11379
+ // { currency: userCurrency }
11380
+ // );
11381
+ // notify.error(errorMsg);
11382
+ // }
11374
11383
  });
11375
11384
  }
11376
11385
  }
@@ -56449,24 +56458,6 @@ const CartContainer = ({
56449
56458
  content: t("messages.multipleCurrencies")
56450
56459
  }
56451
56460
  });
56452
- } else {
56453
- const userCurrency = window.Pelcro.user.read().currency;
56454
- const itemsCurrency = cartItems[0].currency;
56455
- if (userCurrency && userCurrency !== itemsCurrency) {
56456
- dispatch({
56457
- type: DISABLE_SUBMIT,
56458
- payload: true
56459
- });
56460
- dispatch({
56461
- type: SHOW_ALERT,
56462
- payload: {
56463
- type: "error",
56464
- content: t("messages.currencyMismatch", {
56465
- currency: userCurrency.toUpperCase()
56466
- })
56467
- }
56468
- });
56469
- }
56470
56461
  }
56471
56462
  }, [cartItems]);
56472
56463
  const submit = (state, dispatch) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pelcro/react-pelcro-js",
3
3
  "description": "Pelcro's React UI Elements",
4
- "version": "4.0.0-alpha.119",
4
+ "version": "4.0.0-alpha.120",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",