@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.
@@ -67,6 +67,7 @@ interface AddCartLinesInput {
67
67
  cartId?: string;
68
68
  /** Lines to add */
69
69
  lines: CartLineInput[];
70
+ updateCookie?: boolean;
70
71
  }
71
72
  /**
72
73
  * Hook for adding lines to cart
@@ -67,6 +67,7 @@ interface AddCartLinesInput {
67
67
  cartId?: string;
68
68
  /** Lines to add */
69
69
  lines: CartLineInput[];
70
+ updateCookie?: boolean;
70
71
  }
71
72
  /**
72
73
  * Hook for adding lines to cart
@@ -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, {