@anker-in/shopify-react 0.1.1-beta.7 → 0.1.1-beta.8
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 +8 -4
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +8 -4
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -4
- package/dist/index.mjs.map +1 -1
- package/dist/provider/index.js +8 -4
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +8 -4
- package/dist/provider/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1439,15 +1439,19 @@ var useCartAttributes = ({
|
|
|
1439
1439
|
];
|
|
1440
1440
|
}, [profile?.memberType, profile?.token, userType, hasPlusMember]);
|
|
1441
1441
|
const functionAttributes = useMemo(() => {
|
|
1442
|
-
|
|
1443
|
-
|
|
1442
|
+
const hasFunctionEnvAttribute = cart?.lineItems.some(
|
|
1443
|
+
(item) => item.customAttributes?.some((attr) => attr.key === CUSTOMER_ATTRIBUTE_KEY)
|
|
1444
|
+
);
|
|
1445
|
+
const discountCodes = cart?.discountCodes.map((item) => item.code).filter((code) => code) || [];
|
|
1446
|
+
return hasFunctionEnvAttribute ? [
|
|
1447
|
+
{
|
|
1444
1448
|
key: "_discounts_function_env",
|
|
1445
1449
|
value: JSON.stringify({
|
|
1446
|
-
discount_code:
|
|
1450
|
+
discount_code: discountCodes,
|
|
1447
1451
|
user_tags: customer?.tags || []
|
|
1448
1452
|
})
|
|
1449
1453
|
}
|
|
1450
|
-
];
|
|
1454
|
+
] : [];
|
|
1451
1455
|
}, [cart]);
|
|
1452
1456
|
const presellAttributes = useMemo(() => {
|
|
1453
1457
|
return [
|