Post by pgdev0 » Thu Feb 09, 2023 3:17 pm

Hi All, I have installed opencart 3.0.3.8 version recently and I'm facing this problem - whenever i try to click on add to cart button, its adds the product in cart but when i move to next step i.e. checkout page - the cart becomes empty. When i click back button , the cart still shows that 1 product which I added. For resolving the issue, i again freshly installed opencart 3.0.3.8 , It was working fine however i faced new issue where it was showing error "warning - shipping method required" in shipping details section of checkout page. The current state is sometimes it shows empty cart issue and even if it lets me to fill first 2 steps of checkout page , it shows shipping method issue. May i please know what is the problem and how to resolve it? I'm beginner at this . Please help me! :( I've attached few snaps to get idea.

Attachments

Screenshot 2023-02-09 123942.jpg

This issue is faced during checkout steps - Screenshot 2023-02-09 123942.jpg (61.2 KiB) Viewed 2947 times

Screenshot 2023-02-09 124002.jpg

This happened after clicking checkout button - Screenshot 2023-02-09 124002.jpg (56.44 KiB) Viewed 2947 times

Screenshot 2023-02-09 124014.jpg

this happened after clicking back button, it showed empty cart but in this picture the cart still exists. - Screenshot 2023-02-09 124014.jpg (72.29 KiB) Viewed 2947 times


Newbie

Posts

Joined
Thu Feb 09, 2023 2:41 pm

Post by ADD Creative » Thu Feb 09, 2023 10:31 pm

Could be this issue. https://github.com/opencart/opencart/issues/7008

You may be able to test by using your web browser's developer tool to disable the cache.

The easiest way to fix the lack of cache control headers issue is by making the following change to the framework.

In system/framework.php find the following line at around line 74.

Code: Select all

$response->addHeader('Content-Type: text/html; charset=utf-8');
After that line add the following.

Code: Select all

header('Expires: Thu, 19 Nov 1981 08:52:00 GMT', true);
header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0', true);
header('Pragma: no-cache', true);
Note, using header() rather than $response->addHeader() as the later doesn't apply to redirects. I've noticed recently that Firefox aggressively caches redirects, which can lead to some strange issues.

www.add-creative.co.uk


Expert Member

Posts

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

Post by pgdev0 » Fri Feb 10, 2023 5:13 pm

Thank you so much!! The issue is gone. :)

Newbie

Posts

Joined
Thu Feb 09, 2023 2:41 pm
Who is online

Users browsing this forum: No registered users and 19 guests