@anker-in/shopify-react 1.2.0 → 1.2.1

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.
@@ -865,7 +865,7 @@ function getCartBasicAttributes({
865
865
  const presellAttributes = [
866
866
  {
867
867
  key: "_presale",
868
- value: cart?.lineItems?.some((item) => item?.variant?.metafields?.presell === "presell")
868
+ value: cart?.lineItems?.some((item) => item?.variant?.metafields?.presell === "presell") ? "true" : "false"
869
869
  }
870
870
  ];
871
871
  const weightAttributes = [
@@ -906,11 +906,14 @@ function getCartBasicAttributes({
906
906
  ...weightAttributes,
907
907
  ...trackingAttributes,
908
908
  ...getReferralAttributes()
909
- ].filter((item) => item?.value);
909
+ ].filter((item) => item?.value !== void 0 && item?.value !== null);
910
910
  const extraAttributesInCart = cart?.customAttributes?.filter(
911
911
  (item) => !commonAttributes.some((attr) => attr.key === item.key)
912
912
  ) || [];
913
- return [...commonAttributes, ...extraAttributesInCart].filter((item) => item?.value);
913
+ return [...commonAttributes, ...extraAttributesInCart].filter((item) => item?.value !== void 0 && item?.value !== null).map((item) => ({
914
+ key: item.key,
915
+ value: typeof item.value === "string" ? item.value : String(item.value)
916
+ }));
914
917
  }
915
918
  var useCartAttributes = ({
916
919
  profile,