@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.
- package/dist/hooks/index.d.mts +2 -2
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +6 -3
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +6 -3
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -3
- package/dist/index.mjs.map +1 -1
- package/dist/provider/index.js +6 -3
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +6 -3
- package/dist/provider/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1686,7 +1686,7 @@ function getCartBasicAttributes({
|
|
|
1686
1686
|
const presellAttributes = [
|
|
1687
1687
|
{
|
|
1688
1688
|
key: "_presale",
|
|
1689
|
-
value: cart?.lineItems?.some((item) => item?.variant?.metafields?.presell === "presell")
|
|
1689
|
+
value: cart?.lineItems?.some((item) => item?.variant?.metafields?.presell === "presell") ? "true" : "false"
|
|
1690
1690
|
}
|
|
1691
1691
|
];
|
|
1692
1692
|
const weightAttributes = [
|
|
@@ -1727,11 +1727,14 @@ function getCartBasicAttributes({
|
|
|
1727
1727
|
...weightAttributes,
|
|
1728
1728
|
...trackingAttributes,
|
|
1729
1729
|
...getReferralAttributes()
|
|
1730
|
-
].filter((item) => item?.value);
|
|
1730
|
+
].filter((item) => item?.value !== void 0 && item?.value !== null);
|
|
1731
1731
|
const extraAttributesInCart = cart?.customAttributes?.filter(
|
|
1732
1732
|
(item) => !commonAttributes.some((attr) => attr.key === item.key)
|
|
1733
1733
|
) || [];
|
|
1734
|
-
return [...commonAttributes, ...extraAttributesInCart].filter((item) => item?.value)
|
|
1734
|
+
return [...commonAttributes, ...extraAttributesInCart].filter((item) => item?.value !== void 0 && item?.value !== null).map((item) => ({
|
|
1735
|
+
key: item.key,
|
|
1736
|
+
value: typeof item.value === "string" ? item.value : String(item.value)
|
|
1737
|
+
}));
|
|
1735
1738
|
}
|
|
1736
1739
|
var useCartAttributes = ({
|
|
1737
1740
|
profile,
|