IF condition for service price

hey,

I have a calendar tempalte set to include the service price only if the service indeed has a price.

{#if service_price}
This service costs {service_price}
{/if}

 

The problem is that appointment with services without a price render anyway as instead of ommiting this completely 

This service costs $300

 

I suppose it's because the value of the `service_price` variable is not empty even if the actual cost is 0 because it's already formatted. Is there a way to handle this?

 

thanks

 

0

Comments

2 comments
Date Votes
  • ok, by looking at the sources where you evaluate the expression, I see that you support some operators so this template works:

     

    {#if service_price != $0.00}
    This service costs {service_price}
    {/if}

     

    However, it is a bit fragile because if I change the formatting of the service price to e.g. "$0" (without decimals), my template will stop working.

     

    cheers

    0
  • Hello Jan, thanks for your feedback. We forwarded this information to the Dev team for further review.

    0

Please sign in to leave a comment.

Didn't find what you were looking for?

New post