Hi
i'm using 2.3.0.2
all of my products prices are round
and now i want to remove the 00 decimals that showing on my every products price
please guide me
Use The php number formate functionaghafarokh wrote: ↑Mon Dec 18, 2017 9:15 amHi
i'm using 2.3.0.2
all of my products prices are round
and now i want to remove the 00 decimals that showing on my every products price
please guide me
https://www.w3schools.com/php/func_stri ... format.asp
Thanks
There's a great solution here:
http://www.opencart.com/forum/viewtopic ... 20&t=91498
http://www.opencart.com/forum/viewtopic ... 20&t=91498
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
it's not workingpaulfeakins wrote: ↑Mon Dec 18, 2017 8:39 pmThere's a great solution here:
http://www.opencart.com/forum/viewtopic ... 20&t=91498
i'm really tired
i've search all of this forum and try everything
it's not working
when i edit one product and remove the decimal (.00000) from its product and save it
when i refresh the page for the first time all product prices are good without decimal BUT when i refresh it again
those price decimals (.000000) coming baaaacccccckkkkkks
i've search all of this forum and try everything
it's not working
when i edit one product and remove the decimal (.00000) from its product and save it
when i refresh the page for the first time all product prices are good without decimal BUT when i refresh it again
those price decimals (.000000) coming baaaacccccckkkkkks
which opencart vserion you are using let me know also the site url pleaseaghafarokh wrote: ↑Mon Dec 18, 2017 10:11 pmi'm really tired
i've search all of this forum and try everything
it's not working
when i edit one product and remove the decimal (.00000) from its product and save it
when i refresh the page for the first time all product prices are good without decimal BUT when i refresh it again
those price decimals (.000000) coming baaaacccccckkkkkks
on which page you want to do this
so i can help you
Thanks
Sachin
The database itself is designed to hold a number with four decimal places, and if you give it a whole number like 123, the database still stores 123.0000
The OC code then grabs that 123.0000 number and formats it to the appropriate human-readable currency via the currency library in the system folder... so 123.000 becomes $123.00
You could edit your currency library such that it only returns the numbers before the decimal place.
This is a very simple change for an OC developer, and I'd be surprised if there werent any mods that already do it for you.
The OC code then grabs that 123.0000 number and formats it to the appropriate human-readable currency via the currency library in the system folder... so 123.000 becomes $123.00
You could edit your currency library such that it only returns the numbers before the decimal place.
This is a very simple change for an OC developer, and I'd be surprised if there werent any mods that already do it for you.
Settings -> Localisation -> Currencies. Locate the currency of your store (ex. USD) and click the Edit button on the righ (pencil symbol). Under decimal places you probably have 2. Change it 0 then Save. Check a product page in your browser (refresh the browser if you already had it open). It should show the price without the decimals.
Who is online
Users browsing this forum: No registered users and 198 guests