If Condition is not Passed in Smarty Template but it should pass


#1

Hi guys,

I faced a really weird problem and don’t have an idea how to solve it because it happens only for the specific products.
The requirement is:
If Retail Price Netto is greater than Product Netto Price, Display the netto price and also the percentage between Retail Price and Netto Price.

And for some specific products I have the following data in the smarty tpl file:

$RRPPriceNetto: 1.166,63
$nettoPrice: 883.29166666667

So, the $RRPPriceNetto should be displayed and here is the condition:
[{if $RRPPriceNetto > $nettoPrice}]
[{$RRPPriceNetto}]
[{/if}]
But this condition is not passed.
I tried with replace function, to make equal with empty spaces, commas, and points but without success, the if condition is still not passed.

Any idea?

Thanks in advance.


#2

Hi,

you should use unformatted prices for the calculation:

1166.63 > 883.29