Forum

Thread tagged as: Question, Problem, Shop

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>
Jiri Zavadil

Jiri Zavadil 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

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? :)

Drew McLellan

Drew McLellan 2638 points
Perch Support

There are no page functions for displaying variant information currently. Shop is brand new.

okay, where do I vote, please?

Drew McLellan

Drew McLellan 2638 points
Perch Support

On the shop roadmap: https://shop.perchcms.com/roadmap