@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/hooks/index.js
CHANGED
|
@@ -1351,15 +1351,19 @@ var useCartAttributes = ({
|
|
|
1351
1351
|
];
|
|
1352
1352
|
}, [profile?.memberType, profile?.token, userType, hasPlusMember]);
|
|
1353
1353
|
const functionAttributes = react.useMemo(() => {
|
|
1354
|
-
|
|
1355
|
-
|
|
1354
|
+
const hasFunctionEnvAttribute = cart?.lineItems.some(
|
|
1355
|
+
(item) => item.customAttributes?.some((attr) => attr.key === CUSTOMER_ATTRIBUTE_KEY)
|
|
1356
|
+
);
|
|
1357
|
+
const discountCodes = cart?.discountCodes.map((item) => item.code).filter((code) => code) || [];
|
|
1358
|
+
return hasFunctionEnvAttribute ? [
|
|
1359
|
+
{
|
|
1356
1360
|
key: "_discounts_function_env",
|
|
1357
1361
|
value: JSON.stringify({
|
|
1358
|
-
discount_code:
|
|
1362
|
+
discount_code: discountCodes,
|
|
1359
1363
|
user_tags: customer?.tags || []
|
|
1360
1364
|
})
|
|
1361
1365
|
}
|
|
1362
|
-
];
|
|
1366
|
+
] : [];
|
|
1363
1367
|
}, [cart]);
|
|
1364
1368
|
const presellAttributes = react.useMemo(() => {
|
|
1365
1369
|
return [
|