Forum

Thread tagged as: Question, Shop

Show Product variants price

Hi,

I would like to know if is possible to show the product variant price before add it in the cart. Right now i have product variant inside select box and when i select an option it adds the correct item in the cart and the only way to see the price is to go to the cart page. It seems that in template view i don't have variables that contain this information.

This is my code to show product variants in select box maybe it is helpful for someone:

<div class="cart-option">
    <perch:if id="catalog_only" value="0">
      <perch:form id="add_to_cart" app="perch_shop" action="cart.php">
        <perch:if exists="has_variants">

          <perch:productopts>
          <div class="<perch:productopt id="title" />">
            <h4><perch:productopt id="title" /></h4>
                <perch:productvalues>
                  <perch:before>

                    <select id="options-<perch:productvalue id="optionID" />" name="opt-<perch:productvalue id="optionID" />[]" class="" required="required"> 
                        <option disabled="disabled" selected="selected" value="">Please choose</option>
                  </perch:before>
                        <option value="<perch:productvalue id="valueID" />"><perch:productvalue id="valueTitle" /></option>

                  <perch:after>
                    </select>
                    </div>
                  </perch:after>
                </perch:productvalues>
            </perch:productopts>

        </perch:if>

        <div class="qty">
            <h4>QTY</h4>
            <perch:input type="select" options="1,2,3,4,5,6,7,8,9,10" id="qty" />
        </div>
        <div class="clear"></div>
        <perch:input env-autofill="false" id="product" type="hidden" value="<perch:shop id="productID" type="hidden" env-autofill="false" />" />
        <perch:input class="addToCart" type="submit" value="Add to cart" />
      </perch:form>
      <div class="productAdded"></div>
    <perch:else />
      <p>This item is available in-store only.</p>
    </perch:if>
    <div class="closeCart"><a href="#">CLOSE</a></div> 
</div>

Thanks, Vince.

Vincenzo Alaia

Vincenzo Alaia 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

At the moment, no, but it's on the roadmap. Give it a vote to show your support.