@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/index.js
CHANGED
|
@@ -810,14 +810,15 @@ function useAddCartLines(options) {
|
|
|
810
810
|
const { mutateCart, metafieldIdentifiers } = useCartContext();
|
|
811
811
|
const addLines = react.useCallback(
|
|
812
812
|
async (_key, { arg }) => {
|
|
813
|
-
const { cartId, lines } = arg;
|
|
813
|
+
const { cartId, lines, updateCookie = true } = arg;
|
|
814
814
|
const id = cartId || cartCookieAdapter?.getCartId(locale);
|
|
815
815
|
let updatedCart;
|
|
816
816
|
if (!id) {
|
|
817
817
|
updatedCart = await shopifySdk.createCart(client, {
|
|
818
818
|
lines,
|
|
819
819
|
metafieldIdentifiers,
|
|
820
|
-
cookieAdapter: cartCookieAdapter
|
|
820
|
+
cookieAdapter: cartCookieAdapter,
|
|
821
|
+
updateCookie
|
|
821
822
|
});
|
|
822
823
|
} else {
|
|
823
824
|
updatedCart = await shopifySdk.addCartLines(client, {
|