Post by michaelsen » Sun Feb 23, 2025 11:06 pm

I’m running into a persistent issue with OpenCart 4.1.0.0 on my AlmaLinux 9 server with Virtualmin, and I’d really appreciate any insights from the community. After customer registration or login on the front-end, I get a white page with a JSON response like this:
{"redirect":"https:\/\/www.domain.com\/index.php?route=account\/success&language=en-gb&customer_token=6bb681c474dd785ee00d4dc1bd"}
Instead of redirecting to the success page (or account page for login), it just displays this raw JSON and stops. The admin side works fine.
Also when adding a product to the cart from the main page I'm getting this instead of the redirect to product page: {"error":{"option_226":"Select required!"},"redirect":"https:\/\/www.domain.com\/index.php?route=product\/product&language=en-gb&product_id=30"}

Setup Details:
Server: AlmaLinux 9, Virtualmin, Apache 2.4.62, PHP 8.0.30 (FPM via socket), MySQL (MariaDB).
OpenCart: 4.1.0.0 (fresh install from GitHub tags/4.1.0.0).
Paths:
Web root: /home/user/public_html/
Storage: /home/user/storage/ (moved outside public_html as per OC4).
Virtual Host: Configured for xxx.xxx.xxx.xxx:443 with AllowOverride All, self-signed SSL cert (planning Let’s Encrypt fix).
Database: confirmed working (admin uses it).

Any suggestions?
Last edited by michaelsen on Tue Feb 25, 2025 10:44 pm, edited 1 time in total.

New member

Posts

Joined
Tue May 03, 2011 3:17 am

Post by ADD Creative » Mon Feb 24, 2025 1:28 am

Have you checked your web browser's developer console for errors?

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by michaelsen » Mon Feb 24, 2025 1:34 am

Yes, there's nothing and no errors in the OC error log either.

New member

Posts

Joined
Tue May 03, 2011 3:17 am

Post by michaelsen » Tue Feb 25, 2025 7:35 am

I wiped the server, reinstalled the os, reinstalled OC 4.1.0.0 and everything was working. That was this morning. Now, 10 hours later, it's suddenly back to the same issue again.

New member

Posts

Joined
Tue May 03, 2011 3:17 am

Post by OSWorX » Tue Feb 25, 2025 12:52 pm

Just to mention: did you also checked the servers log?
Above is only OC log mentioned!

And, is this instance available via public or (only) a local, private installation.
Finally, is it a "stock" installation or do you have any extensions additionally (installed)?

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 ADD Creative » Tue Feb 25, 2025 7:39 pm

Check catalog/view/javascript/common.js is loading correctly. You can get the issue if it doesn't load or is being blocked by some other JavaScript issue.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by michaelsen » Tue Feb 25, 2025 9:37 pm

ADD Creative wrote:
Tue Feb 25, 2025 7:39 pm
Check catalog/view/javascript/common.js is loading correctly. You can get the issue if it doesn't load or is being blocked by some other JavaScript issue.
It's on the view source page, and the code shows when curl -k https://www.mitechtrading.com/catalog/v ... /common.js
How else can I check it? No errors in "inspect" or logs. I re-uploaded the original common.js and it didn't solve anything.
OSWorX wrote:
Tue Feb 25, 2025 12:52 pm
Just to mention: did you also checked the servers log?
Above is only OC log mentioned!

And, is this instance available via public or (only) a local, private installation.
Finally, is it a "stock" installation or do you have any extensions additionally (installed)?
Nothing in server logs. It's a public install. It's the original theme and I have disabled whatever extensions I had installed.


Here's some additional info.

When this issue resurfaced, I couldn’t log into the admin panel—it displayed the same JSON output and the login page had no CSS styling. I renamed the admin directory back to admin (from a custom name) and updated the config file accordingly. After that, the admin page loaded with proper styling, and I could log in successfully. Later, when prompted to change the directory name again, I chose a new name (different from before), and the admin functionality now works fine.

On the front end, I’ve noticed that after seeing the JSON message during login, I am actually logged in despite the error. During guest checkout, after entering my address and clicking "Continue," it redirects me to domain.com (the homepage). When checking out while logged in, the "Choose" buttons for shipping and payment methods don’t work—they don’t respond when clicked.

New member

Posts

Joined
Tue May 03, 2011 3:17 am

Post by JNeuhoff » Tue Feb 25, 2025 10:14 pm

It would help if you could provide your website URL. OC 4.1.0.0 relies heavily upon Ajax json calls, so it could well be a JQuery issue of some sort.

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


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by michaelsen » Tue Feb 25, 2025 10:23 pm

JNeuhoff wrote:
Tue Feb 25, 2025 10:14 pm
It would help if you could provide your website URL. OC 4.1.0.0 relies heavily upon Ajax json calls, so it could well be a JQuery issue of some sort.
Here you go: FIXED!

New member

Posts

Joined
Tue May 03, 2011 3:17 am

Post by michaelsen » Tue Feb 25, 2025 10:40 pm

Found the issue!!
I had cloudflare rocketloader enabled. I disabled, cleared CF cache and everything works!

AI explanation:

Why Cloudflare Rocket Loader Was the Culprit
What Rocket Loader Does: It’s a Cloudflare feature that optimizes JavaScript loading by asynchronously deferring script execution. While great for performance, it can break sites relying on immediate JS execution—like OpenCart’s common.js for handling AJAX redirects (login, checkout).

Your Symptoms:
  • JSON Redirect: common.js wasn’t executing the redirect, leaving raw JSON—Rocket Loader delayed it.
    No CSS on Admin: Scripts/styles loaded out of order, breaking styling until admin rename reset paths.
    Guest Checkout Redirect: domain.com after "Continue"—AJAX in common.js failed.
    Non-Responsive Buttons: Shipping/payment "Choose" buttons—JS events didn’t fire.
10-Hour Delay: Worked post-reupload until Cloudflare’s cache refreshed or Rocket Loader re-engaged (e.g., after a server restart or TTL expiry).

Why It Worked Initially
Fresh install bypassed Cloudflare cache; reuploaded files triggered a full refresh, activating Rocket Loader’s interference.
Last edited by michaelsen on Tue Feb 25, 2025 11:00 pm, edited 1 time in total.

New member

Posts

Joined
Tue May 03, 2011 3:17 am

Post by Cue4cheap » Tue Feb 25, 2025 10:50 pm

michaelsen wrote:
Tue Feb 25, 2025 10:40 pm
Found the issue!!
I had cloudflare rocketloader enabled. I disabled, cleared CF cache and everything works!
Another weirdness from cloudflare. Never really trusteed them 100%.

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by OSWorX » Tue Feb 25, 2025 11:00 pm

michaelsen wrote:
Tue Feb 25, 2025 10:40 pm
Found the issue!!
I had cloudflare rocketloader enabled. I disabled, cleared CF cache and everything works!
Another reason why it's so important (for us here) to read that before posting: viewtopic.php?p=529151#p529151

@michaelsen: many thanks for that explaination.

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 JNeuhoff » Tue Feb 25, 2025 11:03 pm

yeah, the opencart.com is a prime example why not to use cloudflare :(

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


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am

Who is online

Users browsing this forum: No registered users and 7 guests