HancoEuropa Posted October 11, 2020 Share Posted October 11, 2020 It is entirely possible I'm not very bright. I can't figure out a better way of detecting a zero amount for the Smarty currency strings .... This is what I'm doing (not very elegant!): {if $service_first_payment_amount neq "£0.00" and $service_first_payment_amount neq "€0.00" and $service_first_payment_amount neq "0.00lei"} ... It's just that the text strings don't help much ... What is the smart way to Smarty here? Thanks so much for any tips! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 22, 2020 Share Posted October 22, 2020 On 11/10/2020 at 10:12, HancoEuropa said: It's just that the text strings don't help much ... What is the smart way to Smarty here? I take it from the variables, that this code is in an email template... so options are limited... and even more limited in v8.... if the above works for you then it's fine to use it... I suppose a slightly shorter method would be to use in_array.. {if !in_array($service_first_payment_amount,array("£0.00","€0.00","0.00lei"))} which says that if $service_first_payment_amount does NOT contain a 0.00 amount, then do something. 0 Quote Link to comment Share on other sites More sharing options...
HancoEuropa Posted October 23, 2020 Author Share Posted October 23, 2020 Yes, sorry for not saying it was e-mail template, but you are correct Brian! Yeah, my next step was an array ... could possibly make the array in advance in a hook based on all current currencies and merge that array variable into the $var for the template, would make updating alot easier when a currency is added/deleted later. Suppose other way is if len <=5 and contains 0.00 or 0,00 ... but just as much work really. Thanks so much, most appreciated! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.