Checking if discount code is set

  • There are quite a few ways to check if a discount has been set. I'd suggest you enable <perch:showall> on your cart page and see which ID suits you to test on.

    I've not tried it but there is an ID called discount_code so you could test for that I guess.

    I've implemented it so that if the user has set a discount code then you can check if there's a discount applied to the cart.

    Something like:

    1. <perch:if id="total_discounts" match="gt" value="0.00">
    2.              Voucher applied (<perch:shop id="discount_code">) - <perch:shop id="total_discounts_with_tax_formatted">
    3. </perch:if>