@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.
@@ -1409,8 +1409,29 @@ var useCartAttributes = ({
1409
1409
  [memberAttributes, functionAttributes, presellAttributes, weightAttributes, trackingAttributes]
1410
1410
  );
1411
1411
  const extraAttributesInCart = useMemo(() => {
1412
+ const commonAttributeKeys = [
1413
+ // member attributes
1414
+ "_token",
1415
+ "_member_type",
1416
+ "_user_type",
1417
+ "_is_login",
1418
+ "_login_user",
1419
+ // function attributes
1420
+ "_discounts_function_env",
1421
+ // presell attributes
1422
+ "_presale",
1423
+ // weight attributes
1424
+ "_weight",
1425
+ "_app_source_name",
1426
+ // tracking attributes
1427
+ "utm_params",
1428
+ // referral attributes
1429
+ "_invite_code",
1430
+ "_play_mode_id",
1431
+ "_popup"
1432
+ ];
1412
1433
  return cart?.customAttributes?.filter(
1413
- (item) => !commonAttributes.some((attr) => attr.key === item.key)
1434
+ (item) => !commonAttributeKeys.includes(item.key)
1414
1435
  ) || [];
1415
1436
  }, [cart]);
1416
1437
  return useMemo(
@@ -2625,13 +2646,7 @@ var usePlusMemberItemCustomAttributes = ({
2625
2646
  }) => {
2626
2647
  const { deliveryCustomData } = deliveryData || {};
2627
2648
  return useMemo(() => {
2628
- const itemCustomAttributes = [
2629
- // _last_url: 付费会员结算完成之后 checkout 有一个继续购买的按钮, 用于跳转到继续购买的页面
2630
- {
2631
- key: "_last_url",
2632
- value: typeof window !== "undefined" ? window.location.origin + window.location.pathname : ""
2633
- }
2634
- ];
2649
+ const itemCustomAttributes = [];
2635
2650
  if (deliveryCustomData?.is_presale) {
2636
2651
  itemCustomAttributes.push({
2637
2652
  key: "_is_presale",
@@ -2650,7 +2665,13 @@ var usePlusMemberCheckoutCustomAttributes = ({
2650
2665
  const { deliveryCustomData } = deliveryData || {};
2651
2666
  const { profile } = usePlusMemberContext();
2652
2667
  return useMemo(() => {
2653
- const checkoutCustomAttributes = [];
2668
+ const checkoutCustomAttributes = [
2669
+ // _last_url: 付费会员结算完成之后 checkout 有一个继续购买的按钮, 用于跳转到继续购买的页面
2670
+ {
2671
+ key: "_last_url",
2672
+ value: typeof window !== "undefined" ? window.location.origin + window.location.pathname : ""
2673
+ }
2674
+ ];
2654
2675
  if (deliveryCustomData) {
2655
2676
  checkoutCustomAttributes.push({
2656
2677
  key: "_checkout_delivery_custom",