I want to remove the decimals of our price only on the list and product view. For example I want to change the price from $14,00 to $14,-
In the checkout, e-mails and PDF I want to keep the decimals for the tax.
How can I easily fix this?
I want to remove the decimals of our price only on the list and product view. For example I want to change the price from $14,00 to $14,-
In the checkout, e-mails and PDF I want to keep the decimals for the tax.
How can I easily fix this?
If it's only on those specific places the easiest (not the prettiest) way to do it with a replace in the price.phtml
.
$price = ...;
$price = str_replace(',00', ',-', $price);
Another option would be to have a custom extension that rewrites the formatPrice
method but since it's only visual that might be overkill.
So in price.html
replace
<?php echo $_coreHelper->formatPrice($_price, true) ?>
with
<?php $_price = str_replace(',00', ',-', $_price); ?>
<?php echo $_coreHelper->formatPrice($_price, true) ?>
$price = str_replace(',00', ',-', $price);
What exact line do I need to replace in this file? I do see this line: <?php $_price = $_taxHelper->getPrice($_product, $_convertedPrice); ?>
– Henk Z
Feb 26 '15 at 14:45