commerce-toolkit icon indicating copy to clipboard operation
commerce-toolkit copied to clipboard

Add Line Items Quantity and createCartifNotFound

Open osseonews opened this issue 2 years ago • 0 comments

First off all, awesome library. I've always wondered why nobody developed a production-ready shopping cart in React-query that can easily be imported into any project. Anyway, 2 quick questions:

  1. addLineItemstoCart: This just assumes that someone adds 1 of the item to the cart. But, vast majority of time, people want to add a specific quantity the cart via some quantity selector or input. So there should be a way to add a quantity of the item when adding line items to cart.
  2. createCartifNotFound - not clear how this works. In shopify example in the hooks index it's set to true but then in the fetcher fetchCart, you have a cart is not defined check? Won't the cart always get created now if createcartifnotfound is true? Or how is this used exactly? When is the cart created, if it is not found?

Thanks.

osseonews avatar Apr 20 '23 02:04 osseonews