If I adjust the decimal format of the 'product' or 'product_specials' tables, they just automatically go back to the way they were (OC v1.5.4.1). I know I can change the currency decimal options, but I don't want to globally remove cents since I like offering $4.99 flat rate shipping instead of $5 flat rate shipping (although i suppose that's not so bad). Any advice?ddowdall wrote:Thank you!
Also if you want to remove the extra zero's from the price of products or specials, go to product or product_specials table in database and change the decimal format for the price field.
Never mind, found it!tgulley wrote:If I adjust the decimal format of the 'product' or 'product_specials' tables, they just automatically go back to the way they were (OC v1.5.4.1). I know I can change the currency decimal options, but I don't want to globally remove cents since I like offering $4.99 flat rate shipping instead of $5 flat rate shipping (although i suppose that's not so bad). Any advice?ddowdall wrote:Thank you!
Also if you want to remove the extra zero's from the price of products or specials, go to product or product_specials table in database and change the decimal format for the price field.
Edit: system/library/currency.php
Replace: return $string;
With: return str_replace('.00','',$string);
Works like a charm!
Hi All,
Sorry to revive and old thread. I have done the above suggested modification in the database but im still not getting the length to change or reduce the decimal place's.
Can someone advise please.
Please see screenshots attached to help.
Sorry to revive and old thread. I have done the above suggested modification in the database but im still not getting the length to change or reduce the decimal place's.
Can someone advise please.
Please see screenshots attached to help.
Attachments
Capture.PNG (81.17 KiB) Viewed 10192 times
Capture2.PNG (175.03 KiB) Viewed 10192 times

after installing the Weight on my OpenShop 1.6 (V1.5.6.1 OpenCart), I want to remove the extra zero's from the Weight as well as from Product Dimension, wich is planned also to get visible on the Product Page.
I have tried all kinds of stuff using the built-in SQL-Manager as well as trying to redo the Product-Detail , but I was unable to get rid of those nasty .000000000
I need some kind of REGEX in order to supress those numbers, but for PHP, I don't know where to place something in order to get it done.
Any Help or advise??
Ernie
My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
For anyone trying to remove those extra .0000000 I hope this is helpful.
Go to your PHPMyAdmin and find oc_product. Click on the "Columns" tab. Find weight, price, dimensions, etc... that have the extra 0's. Press "change." Change the value from "15.8" to 15.0" or "15.1". The number after "15" is the number of 0's. Press "Save".
This answer was found at: http://forum.opencart.com/viewtopic.php?t=65366
"Example, open your database and open coupon table structure, as you can see discount and total has Type decimal(15,4), that means it will add four zeros after digit like 10.0000. If you don't want any zero's than simple change Type to decimal(15,0) it will automatically remove all decimal places." Thanks opcrat!
Go to your PHPMyAdmin and find oc_product. Click on the "Columns" tab. Find weight, price, dimensions, etc... that have the extra 0's. Press "change." Change the value from "15.8" to 15.0" or "15.1". The number after "15" is the number of 0's. Press "Save".
This answer was found at: http://forum.opencart.com/viewtopic.php?t=65366
"Example, open your database and open coupon table structure, as you can see discount and total has Type decimal(15,4), that means it will add four zeros after digit like 10.0000. If you don't want any zero's than simple change Type to decimal(15,0) it will automatically remove all decimal places." Thanks opcrat!
It took me a while to figure this out, but if you modify this line, it will remove the decimals from any prices that end in zeros.
Ex. $9.99 -> $9.99, $9.00 -> $9, $10.00 -> $10
This is perfect for sites that use zero decimal places, but need to calculate taxes to the penny and include them in the final total at the end.
Edit: system/library/currency.php
Replace: return $string;
With: return strcmp(substr($string, -3),'.00') ? str_replace('.00','',$string) : $string;
I used it for this website here: http://TrendBuffs.com, and will also be using it for http://ModernTrackers.com
Ex. $9.99 -> $9.99, $9.00 -> $9, $10.00 -> $10
This is perfect for sites that use zero decimal places, but need to calculate taxes to the penny and include them in the final total at the end.
Edit: system/library/currency.php
Replace: return $string;
With: return strcmp(substr($string, -3),'.00') ? str_replace('.00','',$string) : $string;
I used it for this website here: http://TrendBuffs.com, and will also be using it for http://ModernTrackers.com
Who is online
Users browsing this forum: Google [Bot] and 21 guests