Post by inventor96 » Tue Jul 08, 2025 3:00 pm

I'm testing out OpenCart to see if it will work for a project I'm doing. Right now I just have a local development instance on my laptop, running via the Docker configuration in the repo. My installation details are:
1. OC Version 4.1.0.4
2. Default theme
3. 1 locally-developed "module" extension (it currently includes a settings page, a simple banner at the top of the header on admin pages, and functionality to add/modify/remove products and their associated details based on an external source)
4. No additional translations
5. PHP Version 8.4.8
6. Brave 1.80.115 (Chromium: 138.0.7204.97)
7. No CloudFlare or any other WAF/CDN/etc.

When I go to the checkout page, it visually appears to load OK. However, the "Country" and "Region / State" dropdowns are empty except for the default "Please Select" value. When I open my browser's devtools, I see several console log errors:

Code: Select all

GET http://localhost/catalog/view/data/localhost/en-gb/localisation/currency.json 404 (Not Found)
Could not load file localisation/currency.json
GET http://localhost/catalog/view/data/localhost/en-gb/localisation/country.json 404 (Not Found)
Could not load file localisation/country.json
GET http://localhost/catalog/view/data/localhost/en-gb/localisation/country-223.json 404 (Not Found)
Could not load file localisation/country-223.json
When looking at the server response for the respective requests in the Network tab, I can see that the 404 was generated by Apache in the Docker container, indicating the request didn't even make it into OpenCart.

My guesses on the solution are:
1. Perhaps a bug in the formatting of the URL being requested? The URLs above don't look right compared to the pattern of just about every other URL I see when interacting with the site...
2. There's some basic server configuration that I still need to edit on my test site. I'm new to OpenCart, so that's definitely a possibility.

If someone is able to help me figure out the root of this issue, that would be great. Thanks!
Last edited by inventor96 on Thu Jul 10, 2025 10:51 am, edited 1 time in total.

Newbie

Posts

Joined
Thu Jun 26, 2025 2:56 pm


Post by JNeuhoff » Tue Jul 08, 2025 6:35 pm

OpenCart 4.1.0.4 hasn't even been tagged or released, it is still subject to development and bugfixes. For a stable live shop we suggest using OpenCart 3.0.4.1 and PHP 8.3.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by paulfeakins » Tue Jul 08, 2025 6:41 pm

inventor96 wrote:
Tue Jul 08, 2025 3:00 pm
When looking at the server response for the respective requests in the Network tab, I can see that the 404 was generated by Apache in the Docker container, indicating the request didn't even make it into OpenCart.
Probably security/firewall software blocking the request.

OpenCart won't work if its AJAX calls aren't getting through.

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 inventor96 » Wed Jul 09, 2025 5:07 am

JNeuhoff wrote:
Tue Jul 08, 2025 6:35 pm
OpenCart 4.1.0.4 hasn't even been tagged or released, it is still subject to development and bugfixes. For a stable live shop we suggest using OpenCart 3.0.4.1 and PHP 8.3.
Where do I find this recommendation? The latest 3.0.x.x release on GitHub recommends using OC 4... https://github.com/opencart/opencart/releases

Newbie

Posts

Joined
Thu Jun 26, 2025 2:56 pm


Post by inventor96 » Wed Jul 09, 2025 5:09 am

paulfeakins wrote:
Tue Jul 08, 2025 6:41 pm
Probably security/firewall software blocking the request.
Considering the "server" is the Docker container (there's no WAF there), and the Apache web server within that container is responding to the browser (meaning nothing on my laptop is interfering with the request), I find it very unlikely to be a security/firewall issue. With that being said, if there's something else that I'm not thinking of, please do share!

Newbie

Posts

Joined
Thu Jun 26, 2025 2:56 pm


Post by by mona » Wed Jul 09, 2025 3:50 pm

inventor96 wrote:
Wed Jul 09, 2025 5:07 am
Where do I find this recommendation? The latest 3.0.x.x release on GitHub recommends using OC 4... https://github.com/opencart/opencart/releases
Opencart 4 has many bugs and with so few developers using it on a daily basis (due to its issues) fixes will not arrive quickly. Personally I always recommend using the official download page https://www.opencart.com/index.php?rout ... ad/history. This is especially true if you are ever in need of support.

That being said you are free to do as you wish, we can only guide you - we can not make you drink as they say.

Please be aware that we dont work for Opencart, we are not associated with Opencart. Opencart 4 adds no benefit for our clients who are generally more interested in stable Opencart versions (as are we). Stability and security are the most important factors in software versions - latest is generally not advised in Opencart and I can not remember a time when it was. Opencart always releases with issues for testing in the real world - in many ways none of us would be as proficient in Opencart had that not been the case !!!!

Opencart is supported up to php8.3 - which is OC3.0.4.1.
A new version to support for php8.4 is in the works and can be found on github under OC3.0.5.0, but it is not recommended outside of testing until officially released.
OC3.0.4.1 does work without issues on php8.4, but it requires fixing errors (and it has been suggested by a competent developer that he has it working by simply ignoring the errors). Be aware that any modules will not be tested to 8.4, so you will also have to fix those yourself. That will all depend on your own skills which come across as somewhere in the competent coder with experience of another software framework, but little knowledge of Opencart, but that only you know.
php8.4 does feel better and is a touch faster, but nothing that really makes a difference in the real world. It also will be very easy to upgrade from 3.0.4.1 after 3.0.5.0 has been tested.

I also recommend reading the Opencart documentation. https://docs.opencart.com/en-gb/getting-started/
Not particularly brilliant, but useful to people who are new to Opencart to get a handle on the basics and what it can and cant do from your perspective.

Maybe explain your project as most people here will be able to say whether Opencart is suitable - although I have never found it to be unsuitable as of yet - it is a MVC-L framework - not much it cant do if you have the skills to write it - but as with any software - knowledge of the software is a big part of suitability.

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 paulfeakins » Wed Jul 09, 2025 5:59 pm

inventor96 wrote:
Wed Jul 09, 2025 5:09 am
Considering the "server" is the Docker container (there's no WAF there), and the Apache web server within that container is responding to the browser (meaning nothing on my laptop is interfering with the request), I find it very unlikely to be a security/firewall issue.
Are you sure the server set up in Docker doesn't come with any kind of security/firewall by default?

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 inventor96 » Thu Jul 10, 2025 10:40 am

by mona wrote:
Wed Jul 09, 2025 3:50 pm
Opencart 4 has many bugs and with so few developers using it on a daily basis (due to its issues) fixes will not arrive quickly. Personally I always recommend using the official download page https://www.opencart.com/index.php?rout ... ad/history. This is especially true if you are ever in need of support.
Got it. So it's more of a 3rd party recommendation from experience. Thanks for clarifying that.
by mona wrote:
Wed Jul 09, 2025 3:50 pm
That will all depend on your own skills which come across as somewhere in the competent coder with experience of another software framework, but little knowledge of Opencart, but that only you know.
Thanks, yeah, I'm a full-stack software engineer. I normally work on stuff that's built from the ground up, so working with OpenCart is a different context for me.
by mona wrote:
Wed Jul 09, 2025 3:50 pm
Maybe explain your project as most people here will be able to say whether Opencart is suitable - although I have never found it to be unsuitable as of yet - it is a MVC-L framework - not much it cant do if you have the skills to write it - but as with any software - knowledge of the software is a big part of suitability.
I'm helping a neighbor build a web store. The distributor he works with provides an FTP server with TSV files of their catalog and inventory, and an API for placing orders. My neighbor wants to sell a subset of their selection. A fellow technical friend talked to me about OpenCart previously in a different context, so I've been messing around with making a "module" type extension that 1) adds/updates/removes products in OpenCart based on the catalog file, 2) updates the inventory counts in OpenCart based on the inventory file, and 3) "intercepting" orders in OpenCart and passing the applicable selection of the order to the distributor via their API.

I've completed #1 and #2, so now I'm working on #3. My development has been based on the version of OpenCart found on the master branch in the repo. Your points about reliability are definitely valid, so I'll evaluate using version OC 3. I'm open to any tips in going back a version. ;-)

Newbie

Posts

Joined
Thu Jun 26, 2025 2:56 pm


Post by inventor96 » Thu Jul 10, 2025 10:46 am

paulfeakins wrote:
Wed Jul 09, 2025 5:59 pm
Are you sure the server set up in Docker doesn't come with any kind of security/firewall by default?
Yep, 100%. You can see everything docker-compose sets up at https://github.com/opencart/opencart/bl ... ompose.yml. The version I'm currently running is a bit behind the latest one, but the only notable change is the addition of PHP-FPM. As you can see in docker-compose.yml, it's pretty bare-bones; just PHP/PHP-FPM, Apache, and MySQL.

Newbie

Posts

Joined
Thu Jun 26, 2025 2:56 pm


Post by inventor96 » Thu Jul 10, 2025 10:49 am

After further testing and digging through the code, the issue was that SSR (Static Site Rendering, which is still a work-in-progress) hadn't generated the JSON files. You can read more at https://github.com/opencart/opencart/discussions/15033.

Newbie

Posts

Joined
Thu Jun 26, 2025 2:56 pm

Who is online

Users browsing this forum: jhonnmick and 12 guests