@pelcro/react-pelcro-js 3.26.0-beta.73 → 3.26.0-beta.75
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 +42 -34
- package/dist/index.esm.js +42 -34
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -9387,13 +9387,20 @@ class PelcroActions {
|
|
|
9387
9387
|
console.error("invalid item SKU id");
|
|
9388
9388
|
return false;
|
|
9389
9389
|
}
|
|
9390
|
-
|
|
9391
|
-
|
|
9392
|
-
|
|
9393
|
-
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
|
|
9390
|
+
window.Pelcro.ecommerce.products.getSkus();
|
|
9391
|
+
|
|
9392
|
+
// const itemMatchesUserCurrency = skusMatchingUserCurrency.some(
|
|
9393
|
+
// (sku) => sku.id === quickPurchaseItem.id
|
|
9394
|
+
// );
|
|
9395
|
+
|
|
9396
|
+
// if (!itemMatchesUserCurrency) {
|
|
9397
|
+
// const userCurrency = window.Pelcro.user.read().currency;
|
|
9398
|
+
// console.error(
|
|
9399
|
+
// `SKU currency (${quickPurchaseItem.currency}) doesn't match user account's currency (${userCurrency}). users can only purchase SKUs that match their account's currency`
|
|
9400
|
+
// );
|
|
9401
|
+
// return false;
|
|
9402
|
+
// }
|
|
9403
|
+
|
|
9397
9404
|
const quickPurchaseItemWithQuantity = {
|
|
9398
9405
|
...quickPurchaseItem,
|
|
9399
9406
|
quantity: 1
|
|
@@ -11728,21 +11735,24 @@ const init$1 = () => {
|
|
|
11728
11735
|
if (!quickPurchaseItem) {
|
|
11729
11736
|
return console.error("invalid item SKU id");
|
|
11730
11737
|
}
|
|
11731
|
-
|
|
11732
|
-
|
|
11733
|
-
if (itemDidntMatchUserCurrency) {
|
|
11734
|
-
|
|
11735
|
-
|
|
11736
|
-
|
|
11737
|
-
|
|
11738
|
-
|
|
11739
|
-
|
|
11740
|
-
|
|
11738
|
+
purchaseItem(itemSkuId);
|
|
11739
|
+
|
|
11740
|
+
// if (itemDidntMatchUserCurrency) {
|
|
11741
|
+
// const userCurrency = window.Pelcro.user
|
|
11742
|
+
// .read()
|
|
11743
|
+
// .currency?.toUpperCase();
|
|
11744
|
+
// const errorMsg = i18n.t(
|
|
11745
|
+
// "shop:messages.currencyMismatch",
|
|
11746
|
+
// { currency: userCurrency }
|
|
11747
|
+
// );
|
|
11748
|
+
// notify.error(errorMsg);
|
|
11749
|
+
// }
|
|
11741
11750
|
});
|
|
11742
11751
|
}
|
|
11743
11752
|
}
|
|
11744
11753
|
});
|
|
11745
11754
|
};
|
|
11755
|
+
|
|
11746
11756
|
const authenticatedButtons = () => {
|
|
11747
11757
|
saveToMetadataButton.authenticated();
|
|
11748
11758
|
const pelcroLoginByClass = document.getElementsByClassName("pelcro-login-button");
|
|
@@ -28837,23 +28847,21 @@ const CartContainer = _ref => {
|
|
|
28837
28847
|
}
|
|
28838
28848
|
});
|
|
28839
28849
|
} else {
|
|
28840
|
-
|
|
28841
|
-
|
|
28842
|
-
|
|
28843
|
-
|
|
28844
|
-
|
|
28845
|
-
|
|
28846
|
-
|
|
28847
|
-
|
|
28848
|
-
|
|
28849
|
-
|
|
28850
|
-
|
|
28851
|
-
|
|
28852
|
-
|
|
28853
|
-
|
|
28854
|
-
|
|
28855
|
-
});
|
|
28856
|
-
}
|
|
28850
|
+
window.Pelcro.user.read().currency;
|
|
28851
|
+
cartItems[0].currency;
|
|
28852
|
+
|
|
28853
|
+
// if (userCurrency && userCurrency !== itemsCurrency) {
|
|
28854
|
+
// dispatch({ type: DISABLE_SUBMIT, payload: true });
|
|
28855
|
+
// dispatch({
|
|
28856
|
+
// type: SHOW_ALERT,
|
|
28857
|
+
// payload: {
|
|
28858
|
+
// type: "error",
|
|
28859
|
+
// content: t("messages.currencyMismatch", {
|
|
28860
|
+
// currency: userCurrency.toUpperCase()
|
|
28861
|
+
// })
|
|
28862
|
+
// }
|
|
28863
|
+
// });
|
|
28864
|
+
// }
|
|
28857
28865
|
}
|
|
28858
28866
|
}, [cartItems]);
|
|
28859
28867
|
const submit = (state, dispatch) => {
|
package/dist/index.esm.js
CHANGED
|
@@ -9357,13 +9357,20 @@ class PelcroActions {
|
|
|
9357
9357
|
console.error("invalid item SKU id");
|
|
9358
9358
|
return false;
|
|
9359
9359
|
}
|
|
9360
|
-
|
|
9361
|
-
|
|
9362
|
-
|
|
9363
|
-
|
|
9364
|
-
|
|
9365
|
-
|
|
9366
|
-
|
|
9360
|
+
window.Pelcro.ecommerce.products.getSkus();
|
|
9361
|
+
|
|
9362
|
+
// const itemMatchesUserCurrency = skusMatchingUserCurrency.some(
|
|
9363
|
+
// (sku) => sku.id === quickPurchaseItem.id
|
|
9364
|
+
// );
|
|
9365
|
+
|
|
9366
|
+
// if (!itemMatchesUserCurrency) {
|
|
9367
|
+
// const userCurrency = window.Pelcro.user.read().currency;
|
|
9368
|
+
// console.error(
|
|
9369
|
+
// `SKU currency (${quickPurchaseItem.currency}) doesn't match user account's currency (${userCurrency}). users can only purchase SKUs that match their account's currency`
|
|
9370
|
+
// );
|
|
9371
|
+
// return false;
|
|
9372
|
+
// }
|
|
9373
|
+
|
|
9367
9374
|
const quickPurchaseItemWithQuantity = {
|
|
9368
9375
|
...quickPurchaseItem,
|
|
9369
9376
|
quantity: 1
|
|
@@ -11698,21 +11705,24 @@ const init$1 = () => {
|
|
|
11698
11705
|
if (!quickPurchaseItem) {
|
|
11699
11706
|
return console.error("invalid item SKU id");
|
|
11700
11707
|
}
|
|
11701
|
-
|
|
11702
|
-
|
|
11703
|
-
if (itemDidntMatchUserCurrency) {
|
|
11704
|
-
|
|
11705
|
-
|
|
11706
|
-
|
|
11707
|
-
|
|
11708
|
-
|
|
11709
|
-
|
|
11710
|
-
|
|
11708
|
+
purchaseItem(itemSkuId);
|
|
11709
|
+
|
|
11710
|
+
// if (itemDidntMatchUserCurrency) {
|
|
11711
|
+
// const userCurrency = window.Pelcro.user
|
|
11712
|
+
// .read()
|
|
11713
|
+
// .currency?.toUpperCase();
|
|
11714
|
+
// const errorMsg = i18n.t(
|
|
11715
|
+
// "shop:messages.currencyMismatch",
|
|
11716
|
+
// { currency: userCurrency }
|
|
11717
|
+
// );
|
|
11718
|
+
// notify.error(errorMsg);
|
|
11719
|
+
// }
|
|
11711
11720
|
});
|
|
11712
11721
|
}
|
|
11713
11722
|
}
|
|
11714
11723
|
});
|
|
11715
11724
|
};
|
|
11725
|
+
|
|
11716
11726
|
const authenticatedButtons = () => {
|
|
11717
11727
|
saveToMetadataButton.authenticated();
|
|
11718
11728
|
const pelcroLoginByClass = document.getElementsByClassName("pelcro-login-button");
|
|
@@ -28807,23 +28817,21 @@ const CartContainer = _ref => {
|
|
|
28807
28817
|
}
|
|
28808
28818
|
});
|
|
28809
28819
|
} else {
|
|
28810
|
-
|
|
28811
|
-
|
|
28812
|
-
|
|
28813
|
-
|
|
28814
|
-
|
|
28815
|
-
|
|
28816
|
-
|
|
28817
|
-
|
|
28818
|
-
|
|
28819
|
-
|
|
28820
|
-
|
|
28821
|
-
|
|
28822
|
-
|
|
28823
|
-
|
|
28824
|
-
|
|
28825
|
-
});
|
|
28826
|
-
}
|
|
28820
|
+
window.Pelcro.user.read().currency;
|
|
28821
|
+
cartItems[0].currency;
|
|
28822
|
+
|
|
28823
|
+
// if (userCurrency && userCurrency !== itemsCurrency) {
|
|
28824
|
+
// dispatch({ type: DISABLE_SUBMIT, payload: true });
|
|
28825
|
+
// dispatch({
|
|
28826
|
+
// type: SHOW_ALERT,
|
|
28827
|
+
// payload: {
|
|
28828
|
+
// type: "error",
|
|
28829
|
+
// content: t("messages.currencyMismatch", {
|
|
28830
|
+
// currency: userCurrency.toUpperCase()
|
|
28831
|
+
// })
|
|
28832
|
+
// }
|
|
28833
|
+
// });
|
|
28834
|
+
// }
|
|
28827
28835
|
}
|
|
28828
28836
|
}, [cartItems]);
|
|
28829
28837
|
const submit = (state, dispatch) => {
|