@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 +26 -35
- package/dist/index.esm.js +26 -35
- package/package.json +1 -1
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
|
-
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
|
|
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
|
-
|
|
11407
|
-
|
|
11408
|
-
if (itemDidntMatchUserCurrency) {
|
|
11409
|
-
|
|
11410
|
-
|
|
11411
|
-
|
|
11412
|
-
|
|
11413
|
-
|
|
11414
|
-
|
|
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
|
-
|
|
9168
|
-
|
|
9169
|
-
|
|
9170
|
-
|
|
9171
|
-
|
|
9172
|
-
|
|
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
|
-
|
|
11365
|
-
|
|
11366
|
-
if (itemDidntMatchUserCurrency) {
|
|
11367
|
-
|
|
11368
|
-
|
|
11369
|
-
|
|
11370
|
-
|
|
11371
|
-
|
|
11372
|
-
|
|
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) => {
|