Page 1 of 1

common/currency targets insecure URL in 2.2.

Posted: Sun Jun 19, 2016 12:40 am
by dragonfly-ie
Is there a fix to stop WARNING/POP-UP on index page with SSL? (clean 2.2.)
The page at https://yoursite.com/ contains a form which targets an insecure URL http://yoursite.com/common/currency/currency.

line 41 index-page: <form action="http://yoursite.com/common/currency/currency" method="post" enctype="multipart/form-data" id="form-currency">
When site visitor selects other than default currency, browser will warn that it is sending a non-secure form, and visitor has to allow it. - Not great for customer confidence!
???

Re: common/currency targets insecure URL in 2.2.

Posted: Tue Jun 21, 2016 7:11 am
by dragonfly-ie

Re: common/currency targets insecure URL in 2.2.

Posted: Wed Jun 22, 2016 5:44 am
by Johnathan
This line is the /catalog/controller/common/currency.php file is what determines that form link:

Code: Select all

$data['action'] = $this->url->link('common/currency/currency', '', $this->request->server['HTTPS']);
It could be that the server HTTPS value is not reading properly in your installation. You can try making that line look like this, which should make it always use SSL in OpenCart 2.2:

Code: Select all

$data['action'] = $this->url->link('common/currency/currency', '', true);

Re: common/currency targets insecure URL in 2.2.

Posted: Wed Jun 22, 2016 7:11 pm
by straightlight

Re: common/currency targets insecure URL in 2.2.

Posted: Fri Jun 24, 2016 1:01 am
by integris
This currency fix didn't work for me. I ended up removing the code from the currency tpl /view/common/currency.tpl
Finally, got https/www working accross the site/products/catagories/checkout. I listed the steps in anwer a similar question here: http://stackoverflow.com/questions/3627 ... t/37996993

Re: common/currency targets insecure URL in 2.2.

Posted: Fri Jun 24, 2016 5:30 pm
by dragonfly-ie
Thanks for all your replies.

Unfortunately @Jonathan's fix didn't work for me either.

On the other side, it seems to be browser specific, because I don't get warning/pop-up in Chrome nor Firefox.