
Please help me how to change the price decimals to be lower. Thank you in advance.


Last edited by Anonymous: on Tue Feb 02, 2021 3:10 am, edited 1 time in total.
Edit system/library/cart/currency.php
After:
Add:
Bootstrap sets sup and sub font-size to 75%. You can add line to stylesheet to adjust the font size:
After:
Code: Select all
$string .= number_format($amount, (int)$decimal_place, $this->language->get('decimal_point'), $this->language->get('thousand_point'));
Code: Select all
$dd = '<sup>' . substr($string, (-1 * (int)$decimal_place)) . '</sup>';
$string = substr_replace($string, $dd, (-1 * (int)$decimal_place));
Code: Select all
sub, sup {
font-size: 60%;
}
Please add [SOLVED] to the start of the post title.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Code: Select all
$dd = '<sup>' . substr($string, (-1 * (int)$decimal_place)) . '</sup>';
$string = substr_replace($string, $dd, (-1 * ((int)$decimal_place)-1));
It doesn’t work on product option. Please check photo!
LE: it also doesn’t work under drop down select option. Price is 12,00 and it shows 1200.
LE: it also doesn’t work under drop down select option. Price is 12,00 and it shows 1200.
Attachments
3D652779-A837-4C10-9748-B31A59527027.jpeg (225.34 KiB) Viewed 1656 times
14B85E6A-6605-4B29-83EC-AF07371A4713.jpeg (1.15 MiB) Viewed 1657 times
There's a JS based solution with regex, which will look for any float value, remove comma and add SUP tag on-the-fly for any price on any page. Yet it requires more scripting and tweaking.
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com