Today I am working on a Magento site for a Switzerland client which requires the implementation of Rappen Rounding, a 5-cents rounding for the total price for every transaction.
I actually found an extension on GitHub for that, but it was not compatible with my Magento install. I am not sure if it is not compatible with Magento 1.9.2 or conflicting with any other extensions, it just didn’t work.
After digging into Magento core codes, I found that there is a simple workaround for this functionality, though we have to override Magento’s core. Please be advised that this is not the best practice, it is just a simple workaround. If you want a better functionality and compatibility with future Magento updates, you’d better build a custom module / extension for that.
Here’s what I did as a workaround:
- Override Magento’s core by copying
app/code/core/Mage/Core/Model/store.php
to
app/code/local/Mage/Core/Model/store.php
- Edit the new copied file on the
function roundPrice($price){}
- Replace the line
return round ($ price, 2);
with
return round($price * 2, 1)/2;
- Save
- Flush Magento Cache, and it’s done!
Let me know if it helps!
Thank you! This was exactly what I had to do for a Swiss online shop that I’m developing for in my job. The client will be happy that you saved me so much time – because he pays per hour. You saved me so many headaches because I’m not yet a Magento expert.
Glad it helped you. Thanks for leaving your comment!
Hi! Thanks for your article.
It don’t works on configurable product. How can I fix it?
Have a nice day!
Hi, thanks for coming in!
In my case, it was working well both for simple and configurable products. Do you have the product URL?