Page 1 of 1

[SOLVED] Shop main page appearance problem

Posted: Tue Dec 05, 2023 8:38 pm
by mouser
Hi.
Several years back I installed OpenCart 2.1.0.1 which was the latest version at that time.
Since then it has run smoothly and without almost any kind of problems or technical issues, so I have seen no point in upgrading.
Server is currently running PHP 7.4
About a year ago some clients started to complain about malfunctioning and this is getting more frequent.

The problem is that some browsers (Chrome for example, Brave sometimes, desktop and mobile) do not display the shops main page correctly. It appears as there is no page formatting or theme present. All the products are displayed in one column under each other, there are no graphical details showing up (I use default theme), only product photos appear visible, no other graphical details can be seen. When clicking on a product, then the specific product page appears normal again.

With some browsers like Firefox, the site appears normal, everything as it should be, but other browsers do not show the main page as it should be, displaying only textual content and product photos which are all aligned in one long column.
Can someone please suggest, how to resolve this issue?
I have no great experience with OpenCart, only installed and configured it some 6-7 years ago, then forgot all about it because it was running excellently this far.
PS. admin panel is displayed correctly.

Thank you!

Re: Shop main page appearance problem

Posted: Tue Dec 05, 2023 11:01 pm
by Cue4cheap
mouser wrote:
Tue Dec 05, 2023 8:38 pm
Hi.
Several years back I installed OpenCart 2.1.0.1 which was the latest version at that time.
Since then it has run smoothly and without almost any kind of problems or technical issues, so I have seen no point in upgrading.
Server is currently running PHP 7.4

Thank you!
To start: Downgrade PHP version under 7.4.

Next what errors are the logs?
Mike

Re: Shop main page appearance problem

Posted: Wed Dec 06, 2023 12:41 am
by mouser
Cue4cheap wrote:
Tue Dec 05, 2023 11:01 pm
To start: Downgrade PHP version under 7.4.

Next what errors are the logs?
Mike

PHP version was 7.1 actually, I only today switched to 7.4 and that did not make any visible difference in OpenCart behavior.
Switched back to 7.1 just now.
The error log does not reflect those occasions, when site is accessed and seen in non-correct appearance.
There are some lines in error log though:

PHP Warning: A non-numeric value encountered in /path/catalog/controller/product/manufacturer.php on line 175
PHP Warning: Division by zero in /path/catalog/controller/product/category.php on line 349
PHP Notice: A non well formed numeric value encountered in /path/catalog/model/total/shipping.php on line 24

Those kind of lines appear in error log.

Re: Shop main page appearance problem

Posted: Wed Dec 06, 2023 7:01 pm
by paulfeakins
mouser wrote:
Tue Dec 05, 2023 8:38 pm
It appears as there is no page formatting or theme present.
This is usually an SSL problem.

Make sure both your config.php and admin/config.php files include the full https link everywhere and that your SSL Certificate is valid.

Re: Shop main page appearance problem

Posted: Wed Dec 06, 2023 8:37 pm
by SohBH
Given that the admin panel displays correctly, we can deduce that the HTML error lies within the frontend of the shop and some browser are more sensitive to the error.

Re: Shop main page appearance problem

Posted: Wed Dec 06, 2023 8:45 pm
by ADD Creative
Are you redirecting to you prefered URL?

If you are using https://www.example.com/ in you config.php. You would need to redirect other forms to that URL in your htaccess. So that would be http://www.example.com/, https://example.com/ and http://example.com/.

Re: Shop main page appearance problem

Posted: Thu Dec 07, 2023 1:47 am
by mouser
Thank you all, who replied!
Problem got quickly solved by my web-developer friend.
Fix was quite easy - in config.php the line where https server was defined, letter "s" was missing after http :)