Post by mapleman » Wed Oct 10, 2018 3:45 am

When I add an item and go to checkout, the shipping price is correct (weight-based).
BUT, if I try to add an item so there will be another shipping cost, there is not!
I can add several items so it will be several kilos more, but it still remains on the first shipping cost!
Likewise, I have different testaccounts with different addresses (Sweden, Norway, etc.), but if I log in to the Norwegian account with a different shipping address and make a new order for different products the shipping address is still filled in (with the Swedish address) when I arrive at checkout!
And if I try to go to the next step anyway, I says that I have to fill in shipping address (though there is an address but it is the wrong address .....)
I have tried to clear history etc several times, but it does not help!
However, if I try another browser (google chrome tex), everything works without blame !!!
Anyone else has a problem with this?
EXTREMELY annoying !!!
(I run OC 3.0.2.0 and it´s Explorer 11 that I use when I get the eror!)

Newbie

Posts

Joined
Thu Jun 14, 2018 2:33 am

Post by ADD Creative » Wed Oct 10, 2018 7:57 pm

What happens if you try a F5 refresh in IE? Also try a Control+F5 refresh?

www.add-creative.co.uk


Expert Member

Posts

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

Post by mapleman » Wed Oct 10, 2018 11:25 pm

Nothing....
I have tried on 3 different computers (all with IE 11) and it's the same "error" on all three!

Newbie

Posts

Joined
Thu Jun 14, 2018 2:33 am

Post by Elevate » Thu Oct 11, 2018 2:37 am

I'm curious why you haven't upgraded to Edge? IE 11 was released 5 years ago and that's the end of IE (thank goodness, IMO).

ELEV8TE Website Development
https://www.elev8your.com


User avatar
New member

Posts

Joined
Fri Jul 06, 2018 12:40 am
Location - Denver, Colorado, USA

Post by mapleman » Thu Oct 11, 2018 3:55 am

Elevate wrote:
Thu Oct 11, 2018 2:37 am
I'm curious why you haven't upgraded to Edge? IE 11 was released 5 years ago and that's the end of IE (thank goodness, IMO).
Thats because aprox 32% of the visitors on the Companys website is using IE (whereof 20% using IE 11).
Thereof the importance the shop is working as it should even with that hideous browser....

Newbie

Posts

Joined
Thu Jun 14, 2018 2:33 am

Post by ADD Creative » Thu Oct 11, 2018 6:13 pm

Do you get the same results on the OpenCart demo? https://www.opencart.com/index.php?route=cms/demo

Are you running any extension or custom theme? If so try installing and clean copy on OpenCart in a test directory and try this to eliminate the problem being caused by modifications. If this is also causing problems you could try installing on some other hosting or even a local server and see if you get the same results.

www.add-creative.co.uk


Expert Member

Posts

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

Post by mapleman » Wed Oct 17, 2018 4:31 am

The demoversion does only have flat rate shipping, so I get no help from there since it´s the weight based shipping that is the problem unfortionatly.
I have disabled the extensions that I have installed (Swedish, GDPR strip, GDPR checkbox, Captcha) but still the same problem, and I´m running the default theme.
This is driving me f**king crazy!!!

Newbie

Posts

Joined
Thu Jun 14, 2018 2:33 am

Post by Parmodya » Wed Oct 17, 2018 10:49 pm

Please provide your site address.
Are you having same issue on
https://demo.opencart.com/index.php?route=common/home

Opencart performance optimizations
homepage https://www.fmform.com
Help page https://help.fmform.com


Newbie

Posts

Joined
Thu May 10, 2018 9:40 am


Post by ADD Creative » Thu Oct 18, 2018 1:16 am

The shipping method should not affect the address problem below.
Likewise, I have different test accounts with different addresses (Sweden, Norway, etc.), but if I log in to the Norwegian account with a different shipping address and make a new order for different products the shipping address is still filled in (with the Swedish address) when I arrive at checkout!
And if I try to go to the next step anyway, I says that I have to fill in shipping address (though there is an address but it is the wrong address .....)
Do you still get the above address problem, if you use the Flat Rate shipping module and disable the Weight Based module on your site?

If so that would point to some sort of session or caching problem. You could maybe try each web browser's network inspect tool (usually F12). Compare a working browser against IE 11. You'll have to ignore all the images and assets and just look for index.php which should all be a 200 response code. Also look in the console for any errors or warnings.

www.add-creative.co.uk


Expert Member

Posts

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

Post by mapleman » Thu Oct 18, 2018 6:09 am

Parmodya wrote:
Wed Oct 17, 2018 10:50 pm
Please provide your site address.
Are you having same issue on
https://demo.opencart.com/index.php?route=common/home
The demo is using flat rate shipping so there is no problem with that.
The address to my shop is mapleman.se/webshop
I have tried a friends OC today, and he uses weight based shipping and that works even with IE11, BUT he´s running 2.0.3.1 and I´m running 3.0.2.0, so I´m starting to suspect that there is that version that´s the problem.....
Does anyone else here run OC 3.0.2.0 and have weight based shipping so I can try that one and see if there is the same problem, or if it´s just in my shop?

Newbie

Posts

Joined
Thu Jun 14, 2018 2:33 am

Post by ADD Creative » Thu Oct 18, 2018 8:09 am

I just tested locally with a clean install on Opencart 3 and you are correct that it's only OpenCart 3 with IE 11 that shows the issue. The problem is nothing to do with the shipping modules (which is why you were asked to check the demo site). The cause seems to be that version 3 does not call session_start which usually set the Cache-Control header for the PHP response. IE seems to aggressively cache responses more than the other browsers and not retrieve new content.

As an experimental fix you could try making the following change.
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

$response->addHeader('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
$response->addHeader('Pragma: no-cache');
You will might have to clear your browser cache as well.

www.add-creative.co.uk


Expert Member

Posts

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

Post by mapleman » Fri Oct 19, 2018 3:31 am

ADD Creative wrote:
Thu Oct 18, 2018 8:09 am
I just tested locally with a clean install on Opencart 3 and you are correct that it's only OpenCart 3 with IE 11 that shows the issue. The problem is nothing to do with the shipping modules (which is why you were asked to check the demo site). The cause seems to be that version 3 does not call session_start which usually set the Cache-Control header for the PHP response. IE seems to aggressively cache responses more than the other browsers and not retrieve new content.

As an experimental fix you could try making the following change.
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

$response->addHeader('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
$response->addHeader('Pragma: no-cache');
You will might have to clear your browser cache as well.
OH MY GOD!!!!
IT WORKED!!!!
You are a GENIUS! :D
You can´t imagine what a relief this is to me!!
I am SO thankful for your help!

Newbie

Posts

Joined
Thu Jun 14, 2018 2:33 am

Post by mapleman » Sun Nov 11, 2018 12:02 am

ADD Creative wrote:
Thu Oct 18, 2018 8:09 am
I just tested locally with a clean install on Opencart 3 and you are correct that it's only OpenCart 3 with IE 11 that shows the issue. The problem is nothing to do with the shipping modules (which is why you were asked to check the demo site). The cause seems to be that version 3 does not call session_start which usually set the Cache-Control header for the PHP response. IE seems to aggressively cache responses more than the other browsers and not retrieve new content.

As an experimental fix you could try making the following change.
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

$response->addHeader('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
$response->addHeader('Pragma: no-cache');
You will might have to clear your browser cache as well.
Now there is a new problem.....
I placed an order just for fun and see if everythig is working Before I go live...
Once again in IE 11....
I came all the way to "confirm order" on my laptop, then this came up...

Code: Select all

"Syntax error
OK
<b>Notice</b> :mail(): Policy restriction effect. The fifth parameter is disabled on this system in 
<b>/customers/0/e/dmapleman.se/httpd.www.webshop/system/library/mail/mail.php</b>
on line <b>75</b> {"redirect":http:\/\/www.mapleman.se\/webshop\/index.php?route=checkout\/success"}
This text is repeated in the error box like Three times.
(You can see the pic of the error message here: www.mapleman.se/webshop/error.PNG )

The order does not go through!!

BUT, the strage thing is that IT WORKS on my other computer !!!!!!
Also with IE 11....
Is there anyone who can help me solve this, and explane how the h*** this is possible?!?!?!

The IE version on my laptop (where I get the error) is:
11.0.9600.19129CO
Update: 11.0.85 (KB4457426)

The IE version on my other computer (where it works) is:
11.0.9600.18837
Update: 11.0.48 (KB4047206)

If this is of any help....
Last edited by straightlight on Fri Apr 17, 2020 2:37 am, edited 1 time in total.
Reason: Added code tags.

Newbie

Posts

Joined
Thu Jun 14, 2018 2:33 am

Post by ADD Creative » Sun Nov 11, 2018 1:20 am

I don't know why you get different results, but the error is cause a security feature of your hosting. They are not allowing extra mail parameters. You will need to go to System->Settings->Edit (for your store). Then under the Mail tab clear the "Mail Parameters".

If you do need to use mail parameters, then you need to speak to your host.

Also, on a live store you should switch of displaying of errors. In OpenCart 3 this has to be done in 3 places. Your php.ini (or in user.ini or htaccess in some cases), in system/config/default.php (or one of the other configs) and in the Server tab on your OpenCart settings.

www.add-creative.co.uk


Expert Member

Posts

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

Post by niroc » Mon Oct 21, 2019 5:07 pm

@ ADD Creative, thank you for this solution to the caching problem. It worked instantly and orders are going through well. Brilliant!

Newbie

Posts

Joined
Fri May 30, 2014 3:28 pm

Post by brightwork » Sun Dec 29, 2019 3:29 am

I had this same issue with both Firefox and Chrome, and the above fix seems to have worked. Thanks!

Newbie

Posts

Joined
Mon Jul 22, 2013 5:24 am

Post by Eden85 » Fri Apr 17, 2020 2:36 am

I added this to system/framework, and this resolved the issue. thank you for your help really appreciate it.

Code: Select all

$response->addHeader('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
$response->addHeader('Pragma: no-cache'); 
Hopefully there won't be any more issues because honestly i am afraid to start adding so many products and information and later see another issue popping up while store is live. I am guessing this was an issue from Opencart not Journal 3 so maybe a clean working update to opencart would be great.
Last edited by straightlight on Fri Apr 17, 2020 2:38 am, edited 1 time in total.
Reason: Added code tags.

Newbie

Posts

Joined
Thu Apr 16, 2020 11:49 am

Post by straightlight » Fri Apr 17, 2020 2:47 am

This topic has now been moved to the OpenCart 3.0 Support > General Support section of the forum since the reported issue is about server-specifics and not specifically about Opencart. Not a bug.

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 ADD Creative » Fri Apr 17, 2020 6:33 pm

It is a bug in OpenCart. Nothing to do with server-specifics. Any PHP application that uses sessions will need to control what a web browser can cache. That's why if you use the native PHP sessions, PHP will do this for you. OpenCart version 3 onwards implements its own sessions and fails to control what a web browser caches, so web browsers are free to cache any response they want to, leading to problems.

www.add-creative.co.uk


Expert Member

Posts

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

Post by OSWorX » Fri Apr 17, 2020 7:01 pm

ADD Creative wrote:
Fri Apr 17, 2020 6:33 pm
It is a bug in OpenCart. Nothing to do with server-specifics. Any PHP application that uses sessions will need to control what a web browser can cache. That's why if you use the native PHP sessions, PHP will do this for you. OpenCart version 3 onwards implements its own sessions and fails to control what a web browser caches, so web browsers are free to cache any response they want to, leading to problems.
So, to simply break that down to 1 line: do not use OpenCart 3.x if you want to avoid troubles with cache - correct?

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member
Online

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria
Who is online

Users browsing this forum: No registered users and 40 guests