Forum Academy Marketplace Showcase Pricing Features

How to show a modifiable quantity of a product to add to cart?

Hey there,

I’m building a system in which the “makers” can upload his product on the one side and “eaters” can look for and select those product. Among the data type saved when “makers” upload their product there is a “max order possible”(e.g. the max number of a certain item that is available for purchase). I’m trying to show that quantity as dropdown in the “eaters” side (that is when client search products), but can’t figure out how to show dynamically the right number.
I tried two approaches:

  1. adding an input and an ascending and descending icons with conditions in which by clicking the ascending (or descending) icon the input number should increase/decrease by 1. The input should be disabled and turn red once the value reaches the max order possible. I thought this would work but it does not.
  2. adding a dynamically-sourced dropdown that should feed the data type “quantity list” saved while the “maker” was uploading the details. Also this one does not work…

Any insights?

Yes, I think doing it on a dropdown might be tricky, although not impossible.

Have you looked at the numeric input ?

You can dynamically set the min and max. Can’t see why it wouldn’t work in your situation.

Yes I did (see below) but doing that means that user needs to physically type the quantity (assuming wants more than 1…). Is there a way to make it fancier? i.e. the famous dropdown (see, for instance, Amazon) or by using icons to modify the input’s value? Thanks!

Either would be possible.

You can put the input in a group, and use up/down to drive the value.

Drop down… I would need to have a play, but I think it would be possible to drive it from a new data type with numbers, and limit the search to the maximum.