Forum

Thread tagged as: Shop

Trade prices not being added to cart

Hello, I'm having a bit of trouble trade pricing. Have the prices displaying correctly (if a member has the correct tag), but it doesn't add the trade price to the cart.

I have a feeling this probably pretty obvious (suspect perch:shop id="_variant_opts" need to change?) but have been stuck for awhile, any help would be appreciated.

<div class="product-list__product__buy">
    <img src="<perch:shop id="image-listing" type="image" />" alt="<perch:shop id="title" type="text" />" width="200">
    <dl>
        <dt>Available in</dt>
        <perch:variants>
        <dd>
            <perch:variant id="productVariantDesc" type="text" /><br>
            <perch:member has-tag="wholesale">
                <strong><perch:variant id="trade_price" type="shop_currency_value" /></strong>
            <perch:else:member />
                <strong><perch:variant id="price" type="shop_currency_value" /></strong>
            </perch:member>
        </dd>
        </perch:variants>
    </dl>

    <perch:form id="add_to_cart" app="perch_shop" action="">
        <perch:input id="product" type="select" options="<perch:shop id="_variant_opts" type="hidden" />" required="true" />
        <perch:input type="cms" />
        <button class="btn">Add to cart</button>
        <perch:layout path="shop.cart.count" />
    </perch:form>
</div>
Winston Grace

Winston Grace 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Is the trade price showing correctly on the page for trade customers?

Yes, the price updates accordingly on the product page for members logged in with the tag.

Drew McLellan

Drew McLellan 2638 points
Perch Support

So it's actually the product that gets added to the cart, not the price. The price should then be determined based on the cart's regular/sale/trade mode.

Where are you setting the trade status?

Oh, I see now, thank you.

I had:

    if (perch_member_logged_in() && perch_member_has_tag('wholesale')) {  
        perch_shop_enable_trade_pricing();
    }

But because I was setting it atop the product page (instead of a global header) it wasn't applying to the cart and payment pages as well.