Forum
Variant stock level
Hello,
How do I print variant stock level in template? I'm listing the variables with the snippet below. I've searched docs, forum, google and found nothing. Perch is great, but the documentation not so much :(
<perch:form id="add_to_cart" app="perch_shop" action="/cart">
<perch:if exists="has_variants">
<perch:productopts>
<fieldset>
<legend><perch:productopt id="title" /></legend>
<perch:productvalues>
<perch:before><ul></perch:before>
<li>
<label>
<perch:input id="options" name="opt-<perch:productvalue id="optionID" />[]"
value="<perch:productvalue id="valueID" />" type="radio" required="required" />
<perch:productvalue id="valueTitle" />
</label>
</li>
<perch:after></ul></perch:after>
</perch:productvalues>
</fieldset>
</perch:productopts>
</perch:if>
<perch:input id="product" type="hidden" value="<perch:shop id="productID" type="hidden" env-autofill="false" />" />
<perch:input type="submit" class="cart-submit" value="Add to Shopping Bag" />
</perch:form>
That's on the roadmap but isn't available yet. If you'd like to see it I'd encourage you to vote for the feature.
Okay, thanks. At least "on stock"/"out of stock" is available? :)
There are no page functions for displaying variant information currently. Shop is brand new.
okay, where do I vote, please?
On the shop roadmap: https://shop.perchcms.com/roadmap