Post by daneguero » Sun Sep 14, 2025 3:46 pm

Version 4.1.0.3

How to get rid of comma and decimals in prices? Instead 99.00$ display 99 $ and instead 4,599.00$ display 4599 $?

User avatar
Newbie
Online

Posts

Joined
Thu Sep 11, 2025 5:43 pm

Post by by mona » Sun Sep 14, 2025 8:18 pm

system/library/cart/currency.php

Code: Select all

$this->currencies[$result['code']] = ['currency_id' => $result['currency_id'], 'title' => $result['title'], 'symbol_left' => $result['symbol_left'], 'symbol_right' => $result['symbol_right'], 'decimal_place' => $result['decimal_place'], 'value' => $result['value']];
also files :
admin/controller/localisation/currency.php
admin/model/localisation/currency.php
admin/language/*/currency.php
catalog/model/localisation/currency.php

You can find the schema => https://docs.opencart.com/en-gb/developer/module/ (which changes here and there but the logic remain the same even in OC4.
As has been said - Opencart 4 is NOT RECOMMENDED for LIVE sites.

You can download Opencart 3.0.4.1 from the download section => https://www.opencart.com/index.php?rout ... ad/history

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by daneguero » Sun Sep 14, 2025 10:41 pm

by mona wrote:
Sun Sep 14, 2025 8:18 pm
Opencart 4 is NOT RECOMMENDED for LIVE sites.
But why???

User avatar
Newbie
Online

Posts

Joined
Thu Sep 11, 2025 5:43 pm

Post by Cue4cheap » Mon Sep 15, 2025 12:43 am

daneguero wrote:
Sun Sep 14, 2025 10:41 pm
by mona wrote:
Sun Sep 14, 2025 8:18 pm
Opencart 4 is NOT RECOMMENDED for LIVE sites.
But why???
Too many bugs in it.
You will just have problems that you will have to figure out, ask here about, or pay to get working.
Mike

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by daneguero » Mon Sep 15, 2025 2:15 am

Cue4cheap wrote:
Mon Sep 15, 2025 12:43 am
daneguero wrote:
Sun Sep 14, 2025 10:41 pm
by mona wrote:
Sun Sep 14, 2025 8:18 pm
Opencart 4 is NOT RECOMMENDED for LIVE sites.
But why???
Too many bugs in it.
You will just have problems that you will have to figure out, ask here about, or pay to get working.
Mike
What kind of bugs? I am testing it now and already configured it as I need. I have already kinda understood how it works. I like it because of its simplicity.

Is version 3 as simple as version 4 in code? The codes is basically the same or not?

User avatar
Newbie
Online

Posts

Joined
Thu Sep 11, 2025 5:43 pm

Post by Cue4cheap » Mon Sep 15, 2025 3:28 am

daneguero wrote:
Mon Sep 15, 2025 2:15 am
Cue4cheap wrote:
Mon Sep 15, 2025 12:43 am
daneguero wrote:
Sun Sep 14, 2025 10:41 pm
by mona wrote:
Sun Sep 14, 2025 8:18 pm
Opencart 4 is NOT RECOMMENDED for LIVE sites.
But why???
Too many bugs in it.
You will just have problems that you will have to figure out, ask here about, or pay to get working.
Mike
What kind of bugs? I am testing it now and already configured it as I need. I have already kinda understood how it works. I like it because of its simplicity.

Is version 3 as simple as version 4 in code? The codes is basically the same or not?
Read the forum please and make your own decision on it.
Mike

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by by mona » Mon Sep 15, 2025 3:32 am

Lots of bugs - some known some not.
For more details go through the forum or search google.

Opencart has been similar since OC1 but the question you ask is too wide.
But if you are asking if you will have problems understanding OC3 if you can understand OC4 the answer is no. Since it free to download the easy way would be to download it and check for yourself.

In addition there are far more forum answers for OC3 - far more modules - many more free modules - and OC3.0.4.1 (which is basically 3.0.3.8 with php8 support) is stable. It has never been recommended to use the latest OC version before it has been throughly tested - but OC4 has more issues than usual .. a lot more than usual … with more and more being found and left unresolved with little hope on the horizon the next version will be much better.

On the opposite side of the coin - everyone will be very happy for you to join the guinea pigs and fix the errors you find and publish them for all the other Guinea pigs .. the rest of us are more than happy with OC3.0.3.8 (self upgraded for php8) - OC3.0.4.1 or OC2.0.3.2 (self upgraded for php8) and some of us still love OC1.5.5.1 & OC1.5.5.6 - which also have been self upgraded. So each of the OC versions are similar - some versions better than others - but they are different - and some have a better reputation than others .. for a reason - but your site do whatever you want …

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by OSWorX » Mon Sep 15, 2025 2:15 pm

And - at least, OpenCart 4.x is still under heavy development!
Many functions, classes etc. are changing on a "weekly base", new things are added also.

Which means finally, if you go with the current 4.x release and want to update later to 4.2.x etc. > you will have more troubles than you start now with the 3.0.4.1 release, wait then until a stable 4.x release is published and update then from 3.x

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by paulfeakins » Mon Sep 15, 2025 7:17 pm

daneguero wrote:
Sun Sep 14, 2025 10:41 pm
by mona wrote:
Sun Sep 14, 2025 8:18 pm
Opencart 4 is NOT RECOMMENDED for LIVE sites.
But why???
Good question, here's why: https://www.antropy.co.uk/blog/why-we-s ... 3-in-2025/

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by by mona » Mon Sep 15, 2025 8:49 pm

If the decimal solution has worked for you - whether in OC3 or OC4 - please can you mark the topic with [SOLVED] thank you

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by daneguero » Tue Sep 16, 2025 12:18 am

by mona wrote:
Mon Sep 15, 2025 8:49 pm
If the decimal solution has worked for you - whether in OC3 or OC4 - please can you mark the topic with [SOLVED] thank you
It is not solved. Can you help me?

User avatar
Newbie
Online

Posts

Joined
Thu Sep 11, 2025 5:43 pm

Post by by mona » Tue Sep 16, 2025 3:00 am

You are not very forthcoming with information, but ok language could be barrier

The code and where to find it is above .. you are a coder what have you tried and why is it not working ?
Decimals is a variable as is the separator .. there are various ways to remove it .. passing a different variable ? I think if it is passed as empty you might get a php warning so check your code is suitable for php8 … you could also edit it in the twig if you had to - some ways better as it can be done without hard coding .. it is a simple twig replace and o mod can find any price, special or discount in the front end - you do know about ocmod ?

I have not tried a google search but I would be very surprised if the decimal places has not been asked before - have you checked where the information is being collected from yet ? Is it in the database ? Have you tried that?

We don’t know who you are or what skills you have .. but if you are not really confident I suggest a simple replace in twig - not particularly good practice but simple and effective with no damage.

If you are competent - follow the code .. everything you need is provided above

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am
Who is online

Users browsing this forum: Bing [Bot], daneguero, knowband, pprmkr and 14 guests