In modifiers with allow_quantity set to true, how do I get the default quantity? A use case would be for example a vanilla latte has 2 pumps of vanilla syrup by default, and I would like to display the item with 2 pumps by default and user can change that if they want more or less sweet.
There is a way to configure default modifiers, but not default modifier quantities. You can set on_by_default under modifier_data to true which would allow for that option to be toggled on by default, but there is no way to set a default quantity for a modifier via API.
Thank you for the response @jseok, so how should I approach this problem?
Another example besides number of syrup pumps would be the number of espresso shots in a vanilla latte. Showing 0 for both in a e.g. vanilla latte would not be valid.
For multiple modifiers, try to adjust the “default quantity” through your own application logic, i.e., pre-fill the quantity for the item.
For something like the vanilla latte example, it wouldn’t make sense to even give the customer the option to deselect either vanilla syrup or espresso. In this case, consider implementing modifiers that are purely adjustments to the base item rather than to alter the item itself.
@jseok Okay sounds good thank you. Can I please request default_quantity as a feature to be added to the items with allow_quantity of true?