basementstudio / commerce-toolkit

Ship better storefronts 🛍

Home Page:commerce-toolkit-nextjs-shopify.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Line Items Quantity and createCartifNotFound

osseonews opened this issue · comments

commented

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.