Hi Community,
I am looking how to edit the quantity counter on a product page.
Is it possible to set a dropdown in multiples of 50, for example, so the drop down goes 0,50,100,150…
I have not got any code for this yet so a point in the correct direction would be very much appreciated.
Would I use the information in the hyperlink below to get my Add to Cart button to point at a quantity drop down?
https://www.wix.com/corvid/reference/$w.CartIcon.html#addToCart
Any help would be very much appreciated.
Theo
Hey there,
You’re on the right track! You’d need to first set your dropdown options to reflect the inventory quantities you’d like your customers to select from and then add the selected amount to the cart with addToCart() .
Then you can track and update your inventory with the inventory API by its inventory ID which is the ID assigned to the product in its database collection.
https://www.wix.com/corvid/reference/wix-stores-backend.html#updateInventoryVariantFields
You can reference the article link below to track your inventory in your database collection
https://support.wix.com/en/article/corvid-wix-stores-inventoryitems-collection-fields
Hope this info was helpful to you.
Best regards,
Miguel