@anker-in/shopify-react 0.1.1-beta.16 → 0.1.1-beta.18
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/hooks/index.js +30 -9
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +30 -9
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.js +30 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -9
- package/dist/index.mjs.map +1 -1
- package/dist/provider/index.js +22 -1
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +22 -1
- package/dist/provider/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1514,8 +1514,29 @@ var useCartAttributes = ({
|
|
|
1514
1514
|
[memberAttributes, functionAttributes, presellAttributes, weightAttributes, trackingAttributes]
|
|
1515
1515
|
);
|
|
1516
1516
|
const extraAttributesInCart = react.useMemo(() => {
|
|
1517
|
+
const commonAttributeKeys = [
|
|
1518
|
+
// member attributes
|
|
1519
|
+
"_token",
|
|
1520
|
+
"_member_type",
|
|
1521
|
+
"_user_type",
|
|
1522
|
+
"_is_login",
|
|
1523
|
+
"_login_user",
|
|
1524
|
+
// function attributes
|
|
1525
|
+
"_discounts_function_env",
|
|
1526
|
+
// presell attributes
|
|
1527
|
+
"_presale",
|
|
1528
|
+
// weight attributes
|
|
1529
|
+
"_weight",
|
|
1530
|
+
"_app_source_name",
|
|
1531
|
+
// tracking attributes
|
|
1532
|
+
"utm_params",
|
|
1533
|
+
// referral attributes
|
|
1534
|
+
"_invite_code",
|
|
1535
|
+
"_play_mode_id",
|
|
1536
|
+
"_popup"
|
|
1537
|
+
];
|
|
1517
1538
|
return cart?.customAttributes?.filter(
|
|
1518
|
-
(item) => !
|
|
1539
|
+
(item) => !commonAttributeKeys.includes(item.key)
|
|
1519
1540
|
) || [];
|
|
1520
1541
|
}, [cart]);
|
|
1521
1542
|
return react.useMemo(
|
|
@@ -2730,13 +2751,7 @@ var usePlusMemberItemCustomAttributes = ({
|
|
|
2730
2751
|
}) => {
|
|
2731
2752
|
const { deliveryCustomData } = deliveryData || {};
|
|
2732
2753
|
return react.useMemo(() => {
|
|
2733
|
-
const itemCustomAttributes = [
|
|
2734
|
-
// _last_url: 付费会员结算完成之后 checkout 有一个继续购买的按钮, 用于跳转到继续购买的页面
|
|
2735
|
-
{
|
|
2736
|
-
key: "_last_url",
|
|
2737
|
-
value: typeof window !== "undefined" ? window.location.origin + window.location.pathname : ""
|
|
2738
|
-
}
|
|
2739
|
-
];
|
|
2754
|
+
const itemCustomAttributes = [];
|
|
2740
2755
|
if (deliveryCustomData?.is_presale) {
|
|
2741
2756
|
itemCustomAttributes.push({
|
|
2742
2757
|
key: "_is_presale",
|
|
@@ -2755,7 +2770,13 @@ var usePlusMemberCheckoutCustomAttributes = ({
|
|
|
2755
2770
|
const { deliveryCustomData } = deliveryData || {};
|
|
2756
2771
|
const { profile } = usePlusMemberContext();
|
|
2757
2772
|
return react.useMemo(() => {
|
|
2758
|
-
const checkoutCustomAttributes = [
|
|
2773
|
+
const checkoutCustomAttributes = [
|
|
2774
|
+
// _last_url: 付费会员结算完成之后 checkout 有一个继续购买的按钮, 用于跳转到继续购买的页面
|
|
2775
|
+
{
|
|
2776
|
+
key: "_last_url",
|
|
2777
|
+
value: typeof window !== "undefined" ? window.location.origin + window.location.pathname : ""
|
|
2778
|
+
}
|
|
2779
|
+
];
|
|
2759
2780
|
if (deliveryCustomData) {
|
|
2760
2781
|
checkoutCustomAttributes.push({
|
|
2761
2782
|
key: "_checkout_delivery_custom",
|