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?
{"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.
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.
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)?
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.
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.jsADD Creative wrote: ↑Tue Feb 25, 2025 7:39 pmCheck 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.
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.
Nothing in server logs. It's a public install. It's the original theme and I have disabled whatever extensions I had installed.OSWorX wrote: ↑Tue Feb 25, 2025 12:52 pmJust 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)?
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.
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
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:
Why It Worked Initially
Fresh install bypassed Cloudflare cache; reuploaded files triggered a full refresh, activating Rocket Loader’s interference.
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.
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.
Another weirdness from cloudflare. Never really trusteed them 100%.michaelsen wrote: ↑Tue Feb 25, 2025 10:40 pmFound the issue!!
I had cloudflare rocketloader enabled. I disabled, cleared CF cache and everything works!
cue4cheap not cheap quality
Another reason why it's so important (for us here) to read that before posting: viewtopic.php?p=529151#p529151michaelsen wrote: ↑Tue Feb 25, 2025 10:40 pmFound the issue!!
I had cloudflare rocketloader enabled. I disabled, cleared CF cache and everything works!
@michaelsen: many thanks for that explaination.
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
Re: [SOLVED] OpenCart 4.1.0.0 Front-End Login/Registration Shows JSON Redirect Instead of Completing
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
Who is online
Users browsing this forum: No registered users and 7 guests