@anker-in/shopify-react 1.0.0 → 1.0.1-beta.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 +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +3 -2
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +3 -2
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/hooks/index.d.mts
CHANGED
package/dist/hooks/index.d.ts
CHANGED
package/dist/hooks/index.js
CHANGED
|
@@ -722,14 +722,15 @@ function useAddCartLines(options) {
|
|
|
722
722
|
const { mutateCart, metafieldIdentifiers } = useCartContext();
|
|
723
723
|
const addLines = react.useCallback(
|
|
724
724
|
async (_key, { arg }) => {
|
|
725
|
-
const { cartId, lines } = arg;
|
|
725
|
+
const { cartId, lines, updateCookie = true } = arg;
|
|
726
726
|
const id = cartId || cartCookieAdapter?.getCartId(locale);
|
|
727
727
|
let updatedCart;
|
|
728
728
|
if (!id) {
|
|
729
729
|
updatedCart = await shopifySdk.createCart(client, {
|
|
730
730
|
lines,
|
|
731
731
|
metafieldIdentifiers,
|
|
732
|
-
cookieAdapter: cartCookieAdapter
|
|
732
|
+
cookieAdapter: cartCookieAdapter,
|
|
733
|
+
updateCookie
|
|
733
734
|
});
|
|
734
735
|
} else {
|
|
735
736
|
updatedCart = await shopifySdk.addCartLines(client, {
|