Variant Quantity - Debut Theme

Highlighted
Excursionist
24 2 6

I would like to add an available quantity label on the product page for the selected variant.  I figured I could use variant.inventory_quantity but that does not exist in the current_variant variable set in the product-template.liquid file.  Also, when you select a variant the current_variant variable is not updated.  I understand that this is being updated in a callback type function but if the property does not exist in the item then I can't update it.  Not sure what to do here.  My intent is to use the inventory quantity to set the max value of the quantity selection input therefore not allowing a use to add more than is available to their cart and not have to display an error if they do add more.

Thoughts?

 

Thanks,
Mike
0 Likes
Highlighted
Excursionist
24 2 6

So with a little work I found my own solution.  Took a bit of editing the theme.js file.  From what I found the existing code out there strictly depends on you having SKU's setup for your products.  Not sure we are using them as it is just 2 people now.  So I had to make some changes and add some functions so that for the Quantity it checks the variant.id value and then can change the text as needed.

Thanks,
Mike
0 Likes