Post by astonishedman » Wed Nov 25, 2020 12:30 am

I am running Version 3.0.3.2 with theme "inverted black white". I had the store up and running and recently discovered issues with checkout. The last successful order was in May. I tried to purchase a product by first registering an account. After registration it took me to checkout with option to login, register or checkout as guest. I logged in and it took me back to the same page asking me to login again. So login checkout is not working. I tried to check out as a guest and after entering my information and clicking continue it takes me back to the start of the checkout page again. I cannot check out with my product.

After clearing cache and starting the test over, I found I can check out as a guest initially. But if I go back and try to login as a customer, the login doesn't take and afterwards guest checkout will not work either. I inquired of dedicated support and they suggested it sounds like a session issue. They want $250 to fix it, so I was hoping to find a less costly answer here before I go that route.

Any ideas on how to solve this? Where to look for session trouble?

I have few extensions installed: The theme "inverted black white"; Category Product Based Shipping; Square; product_option_actual_price

Newbie

Posts

Joined
Sat Nov 16, 2019 3:59 am

Post by ADD Creative » Wed Nov 25, 2020 12:40 am

You could check you web browser's development console (usually F12) to see if there are any errors or messages when the problem occurs.

www.add-creative.co.uk


Expert Member

Posts

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

Post by straightlight » Wed Nov 25, 2020 12:46 am

They want $250 to fix it, so I was hoping to find a less costly answer here before I go that route.
You could always create a new service request in the Commercial Support section of the forum, or contact an Opencart partner by using the Resources link at the top of the site, or contact me directly via PM to get this done as a custom job.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by sw!tch » Wed Nov 25, 2020 1:37 am

astonishedman wrote:
Wed Nov 25, 2020 12:30 am
After clearing cache and starting the test over, I found I can check out as a guest initially.
Sounds like it might again be related to improper Cache headers.

See if you can duplicate with Chrome Inspector. In Chrome Inspector go under the network panel, it will have a checkbox to disable cache. Keep Chrome Inspector open and redo the process.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by paulfeakins » Wed Nov 25, 2020 8:04 pm

astonishedman wrote:
Wed Nov 25, 2020 12:30 am
The last successful order was in May.
You didn't notice you were getting no orders for 6 months? :o

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by astonishedman » Wed Nov 25, 2020 10:34 pm

I tried the same testing in Chrome with the inspector console open. I logged in and it reloaded the login page. Just to see what would happen, I tried logging in again with a wrong password. The login page refreshed with no error about a bad password. It's like it is ignoring the submission altogether and just reloading the checkout page.
The only error in the console doesn't appear to be related to the issue: "DevTools failed to load SourceMap: Could not load content for https://bigbottombass.com/catalog/view/ ... os.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE"

I found some more possible clues. I clicked "Forgot Password" and it took me to my account page as though I was logged in. I noticed I now have 4 items in my cart so somehow refreshing the cart page was adding quantity to my cart. I went back to the checkout page and I was still unable to advance to step 2. The icon at the top for account, when clicked from the checkout page, gives me a choice to register or login. But from any other page it gives options "My Account, Order History, etc" as though I'm logged in. On a product page I see the number 4 over the cart as though I have 4 items in the card. When I clicked, the pop up shows 1 item in the cart. Then I clicked "View Cart" and it says the cart is empty. It's like every page has a mind of its own.

Does this give any clues?

Newbie

Posts

Joined
Sat Nov 16, 2019 3:59 am

Post by astonishedman » Wed Nov 25, 2020 10:37 pm

paulfeakins wrote:
Wed Nov 25, 2020 8:04 pm
astonishedman wrote:
Wed Nov 25, 2020 12:30 am
The last successful order was in May.
You didn't notice you were getting no orders for 6 months? :o
I'm the web developer for this site not the owner or the one who manages it. I just noticed because I actually came as a customer to order something and it didn't work so I logged in to check things out. The manager of the website has another business which has been suffering during this crazy year and all his attention has been there. So that's the scoop on why it wasn't noticed.

Newbie

Posts

Joined
Sat Nov 16, 2019 3:59 am

Post by ADD Creative » Wed Nov 25, 2020 11:31 pm

Looking at the link you posted. It looks like a browser caching issue. You expires header in the response is set a month in advance. This means your web browser will probably not bother reloading the page one logged in.

There is a bug in OpenCart 3 in that it doesn't set appropriate cache control headers for dynamic content. See the link below for a description and workaround.
viewtopic.php?f=202&t=206449#p786660

This problem is being made worst by your expires header.

www.add-creative.co.uk


Expert Member

Posts

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

Post by astonishedman » Thu Nov 26, 2020 12:52 am

ADD Creative wrote:
Wed Nov 25, 2020 11:31 pm
Looking at the link you posted. It looks like a browser caching issue. You expires header in the response is set a month in advance. This means your web browser will probably not bother reloading the page one logged in.

There is a bug in OpenCart 3 in that it doesn't set appropriate cache control headers for dynamic content. See the link below for a description and workaround.
viewtopic.php?f=202&t=206449#p786660

This problem is being made worst by your expires header.
Thank you. I added the below to my .htaccess. I also implemented the fix from the link you provided. I'm happy to report that I was able to process my order. Thank you!


# cache control
<IfModule mod_headers.c>
# Caching images and other static files for a month
<FilesMatch ".(ico|jpe?g|png|webp|gif|swf|flv|css|js|gz|pdf|svg+xml|svg)$">
Header set Cache-Control "max-age=2592000"
</FilesMatch>

# Caching of html and xml for 12 hours
<filesMatch ".(html|htm|xml)$">
Header set Cache-Control "max-age=43200"
</filesMatch>

# Disable caching for PHP and CGI files
<FilesMatch ".(php|cgi)$">
Header unset Cache-Control
</FilesMatch>
</IfModule>

# The expires headers
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 7200 seconds"
AddType image/x-icon .ico
AddType application/x-font-woff .woff
AddType application/x-font-woff2 .woff2
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/ico "access plus 1 year"
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/icon "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType text/css "access plus 1 year"
ExpiresByType text/html "access plus 7200 seconds"
ExpiresByType text/javascript "access plus 1 year"
ExpiresByType application/xhtml+xml "access plus 7200 seconds"
ExpiresByType application/x-javascript "access plus 1 year"
ExpiresByType application/x-shockwave-flash "access plus 1 year"
ExpiresByType application/x-font-woff "access plus 1 year"
ExpiresByType application/x-font-woff2 "access plus 1 year"
</IfModule>

<IfModule mod_headers.c>
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires 0
</IfModule>

Newbie

Posts

Joined
Sat Nov 16, 2019 3:59 am

Post by astonishedman » Thu Nov 26, 2020 1:06 am

sw!tch wrote:
Wed Nov 25, 2020 1:37 am
Sounds like it might again be related to improper Cache headers.
Thank you, Switch. You were right.

Newbie

Posts

Joined
Sat Nov 16, 2019 3:59 am

Post by ADD Creative » Thu Nov 26, 2020 1:15 am

astonishedman wrote:
Thu Nov 26, 2020 12:52 am
Thank you. I added the below to my .htaccess. I also implemented the fix from the link you provided. I'm happy to report that I was able to process my order. Thank you!

Code: Select all

<IfModule mod_headers.c>
	Header set Cache-Control "no-cache, no-store, must-revalidate"
	Header set Pragma "no-cache"
	Header set Expires 0
</IfModule>
You don't want that bit as it prevents caching of all your files. Make the changes to system/framework.php in the link I posted or only apply those headers to PHP generated responses.

www.add-creative.co.uk


Expert Member

Posts

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

Post by spectreav » Thu Nov 26, 2020 1:42 am

astonishedman wrote:
Thu Nov 26, 2020 12:52 am
# cache control
<IfModule mod_headers.c>
# Caching images and other static files for a month
<FilesMatch ".(ico|jpe?g|png|webp|gif|swf|flv|css|js|gz|pdf|svg+xml|svg)$">
Header set Cache-Control "max-age=2592000"
</FilesMatch>

# Caching of html and xml for 12 hours
<filesMatch ".(html|htm|xml)$">
Header set Cache-Control "max-age=43200"
</filesMatch>

# Disable caching for PHP and CGI files
<FilesMatch ".(php|cgi)$">
Header unset Cache-Control
</FilesMatch>
</IfModule>

# The expires headers
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 7200 seconds"
AddType image/x-icon .ico
AddType application/x-font-woff .woff
AddType application/x-font-woff2 .woff2
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/ico "access plus 1 year"
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/icon "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType text/css "access plus 1 year"
ExpiresByType text/html "access plus 7200 seconds"
ExpiresByType text/javascript "access plus 1 year"
ExpiresByType application/xhtml+xml "access plus 7200 seconds"
ExpiresByType application/x-javascript "access plus 1 year"
ExpiresByType application/x-shockwave-flash "access plus 1 year"
ExpiresByType application/x-font-woff "access plus 1 year"
ExpiresByType application/x-font-woff2 "access plus 1 year"
</IfModule>

<IfModule mod_headers.c>
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires 0
</IfModule>

Don't use ExpiresDefault and ExpiresByType text/html "access plus 7200 seconds" !

you will get a static store with static cart, wishlist, etc

great seo optimizers use this without understanding

Best All in One Remarketing And Ecommerce Solution for Opencart. Free Install and Setup


New member

Posts

Joined
Sun Oct 25, 2020 7:24 pm

Post by astonishedman » Thu Nov 26, 2020 2:56 am

ADD Creative wrote:
Thu Nov 26, 2020 1:15 am
astonishedman wrote:
Thu Nov 26, 2020 12:52 am
Thank you. I added the below to my .htaccess. I also implemented the fix from the link you provided. I'm happy to report that I was able to process my order. Thank you!

Code: Select all

<IfModule mod_headers.c>
	Header set Cache-Control "no-cache, no-store, must-revalidate"
	Header set Pragma "no-cache"
	Header set Expires 0
</IfModule>
You don't want that bit as it prevents caching of all your files. Make the changes to system/framework.php in the link I posted or only apply those headers to PHP generated responses.
Okay, I took that block out.

Newbie

Posts

Joined
Sat Nov 16, 2019 3:59 am

Post by astonishedman » Thu Nov 26, 2020 2:58 am

spectreav wrote:
Thu Nov 26, 2020 1:42 am

Don't use ExpiresDefault and ExpiresByType text/html "access plus 7200 seconds" !

you will get a static store with static cart, wishlist, etc

great seo optimizers use this without understanding
Okay, I took those two lines out. I got that set from another OpenCart forum post.

Newbie

Posts

Joined
Sat Nov 16, 2019 3:59 am

Post by paulfeakins » Thu Nov 26, 2020 5:34 pm

astonishedman wrote:
Wed Nov 25, 2020 10:37 pm
paulfeakins wrote:
Wed Nov 25, 2020 8:04 pm
astonishedman wrote:
Wed Nov 25, 2020 12:30 am
The last successful order was in May.
You didn't notice you were getting no orders for 6 months? :o
I'm the web developer for this site not the owner or the one who manages it. I just noticed because I actually came as a customer to order something and it didn't work so I logged in to check things out. The manager of the website has another business which has been suffering during this crazy year and all his attention has been there. So that's the scoop on why it wasn't noticed.
Interesting! Just goes to show it's always worth doing regular test orders if you're not getting any real orders.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: JessiesBoutique and 518 guests