@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/hooks/index.js
CHANGED
|
@@ -1418,8 +1418,29 @@ var useCartAttributes = ({
|
|
|
1418
1418
|
[memberAttributes, functionAttributes, presellAttributes, weightAttributes, trackingAttributes]
|
|
1419
1419
|
);
|
|
1420
1420
|
const extraAttributesInCart = react.useMemo(() => {
|
|
1421
|
+
const commonAttributeKeys = [
|
|
1422
|
+
// member attributes
|
|
1423
|
+
"_token",
|
|
1424
|
+
"_member_type",
|
|
1425
|
+
"_user_type",
|
|
1426
|
+
"_is_login",
|
|
1427
|
+
"_login_user",
|
|
1428
|
+
// function attributes
|
|
1429
|
+
"_discounts_function_env",
|
|
1430
|
+
// presell attributes
|
|
1431
|
+
"_presale",
|
|
1432
|
+
// weight attributes
|
|
1433
|
+
"_weight",
|
|
1434
|
+
"_app_source_name",
|
|
1435
|
+
// tracking attributes
|
|
1436
|
+
"utm_params",
|
|
1437
|
+
// referral attributes
|
|
1438
|
+
"_invite_code",
|
|
1439
|
+
"_play_mode_id",
|
|
1440
|
+
"_popup"
|
|
1441
|
+
];
|
|
1421
1442
|
return cart?.customAttributes?.filter(
|
|
1422
|
-
(item) => !
|
|
1443
|
+
(item) => !commonAttributeKeys.includes(item.key)
|
|
1423
1444
|
) || [];
|
|
1424
1445
|
}, [cart]);
|
|
1425
1446
|
return react.useMemo(
|
|
@@ -2634,13 +2655,7 @@ var usePlusMemberItemCustomAttributes = ({
|
|
|
2634
2655
|
}) => {
|
|
2635
2656
|
const { deliveryCustomData } = deliveryData || {};
|
|
2636
2657
|
return react.useMemo(() => {
|
|
2637
|
-
const itemCustomAttributes = [
|
|
2638
|
-
// _last_url: 付费会员结算完成之后 checkout 有一个继续购买的按钮, 用于跳转到继续购买的页面
|
|
2639
|
-
{
|
|
2640
|
-
key: "_last_url",
|
|
2641
|
-
value: typeof window !== "undefined" ? window.location.origin + window.location.pathname : ""
|
|
2642
|
-
}
|
|
2643
|
-
];
|
|
2658
|
+
const itemCustomAttributes = [];
|
|
2644
2659
|
if (deliveryCustomData?.is_presale) {
|
|
2645
2660
|
itemCustomAttributes.push({
|
|
2646
2661
|
key: "_is_presale",
|
|
@@ -2659,7 +2674,13 @@ var usePlusMemberCheckoutCustomAttributes = ({
|
|
|
2659
2674
|
const { deliveryCustomData } = deliveryData || {};
|
|
2660
2675
|
const { profile } = usePlusMemberContext();
|
|
2661
2676
|
return react.useMemo(() => {
|
|
2662
|
-
const checkoutCustomAttributes = [
|
|
2677
|
+
const checkoutCustomAttributes = [
|
|
2678
|
+
// _last_url: 付费会员结算完成之后 checkout 有一个继续购买的按钮, 用于跳转到继续购买的页面
|
|
2679
|
+
{
|
|
2680
|
+
key: "_last_url",
|
|
2681
|
+
value: typeof window !== "undefined" ? window.location.origin + window.location.pathname : ""
|
|
2682
|
+
}
|
|
2683
|
+
];
|
|
2663
2684
|
if (deliveryCustomData) {
|
|
2664
2685
|
checkoutCustomAttributes.push({
|
|
2665
2686
|
key: "_checkout_delivery_custom",
|