Forum
Perch Shop – Conditionaly Show 'Add To Cart' Button
This should work right?
<perch:if id="price" match="gt" value="0.00" />
<perch:input type="submit" value="Add to cart" class="btn btn-secondary" />
</perch:if>
...however it renders the button anyway.
The price will always be greater than zero, won't it?
Not necessarily, they may want the user to contact them for pricing for certain products.
If you output the value of the price field, what is it?
What happens if you flip it and check for the price being equal to
0.00
?I've tried that too, it still doesn't match. Neither does less than.
I've also set the price to a more than zero value as a test i.e. £2.45 and can't match against that either.
What does
<perch:showall />
show you for the price?That's for
price
but there's also aperch_price
too with the same value as aboveHmm, ok, I don't think you'll be able to use the price this way in the current version.
Okay thanks anyway drew.