DARKF3D3 Posted September 19, 2014 Share Posted September 19, 2014 (edited) I try to do in this way, adding a new class "scontato" that add the red color: <span id="our_price_display"{if $productPriceWithoutReduction > $productPrice} class="scontato"{/if} itemprop="price">{convertPrice price=$productPrice}</span> Initially i think it worked, but after some days i notice that there's few products without price reduction but showed red. It's strange, it should apply that class only when there's a price reduction. Edited September 19, 2014 by DARKF3D3 (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted September 19, 2014 Share Posted September 19, 2014 Can you try dumping both variable for those cases? Or simply output them like {$productPriceWithoutReduction } Link to comment Share on other sites More sharing options...
DARKF3D3 Posted September 19, 2014 Author Share Posted September 19, 2014 {$productPriceWithoutReduction} 5.900001 {$productPrice} 5.9 Link to comment Share on other sites More sharing options...
DARKF3D3 Posted September 19, 2014 Author Share Posted September 19, 2014 I find a way to fix it, changed: {if $productPriceWithoutReduction > $productPrice} class="scontato"{/if} To: {if $productPriceWithoutReduction|string_format:"%.2f" > $productPrice|string_format:"%.2f"} class="scontato"{/if} Link to comment Share on other sites More sharing options...
Recommended Posts