Hi wondering if it's possible to do a conditional on price inside of the product tags.

For example..

{if price > '0.00'} Hello {/if}

I'd like display different formatting if price is more than 0.00


You would probably want to use price_val in your conditionals since it will output just the value minus any currency formatting.

{if price_val > 0}Hello{/if}

If you have a product with a price of £10.00 price_val would output 10.00

You can add _val to any of the price related tags like {sale_price_val} or {price_inc_mod_val}

From the docs:

All price variables are pre-formatted according to your currency formatting settings. If you want the unformatted amount, simply append _val to the variable.

| improve this answer | |

Looks like this is working:

{if price != "£0.00"} Hello {/if}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.