News:

Looking for documentation? Take a look on our wiki

Main Menu

for those who wants to remove trailing zeros from prices

Started by rdcustom, May 23, 2024, 12:23:58 PM

Previous topic - Next topic

rdcustom

did a trick today, I post here for future reference in case of updates:

currencydisplay.php

on line 301

add:

$res = preg_replace('/\,00/', '', $res);
$res = rtrim($res, ",");

this will show prices without useless ",00"

125,00 will result in "125"

rdcustom


sirius

Good point,
but I think it's up to you to do an override for this in your template.
Because some of us also want this for example :
<span>79€<sup>00</sup></span>
J3.10.12 | PHP 7.4.33 + APC + Opcode
VM Prod : 3.8.6 | VM Test : 4.4.4 11100