Page 1 of 1
[solved] Currency change causes HTTPS?
Posted: Sun Jun 17, 2012 11:51 am
by yarac
Hi all,
I noticed if I go to a product/category page and change currency while being on the page, the product/category url address suddenly changed to HTTPS and has insecure content warning.
To see what I mean, try changing the currency on my site's category page here.
http://www.ziccy.com/shoes
I know the facebook like box is the cause of the warnings but I thought SSL should only work on the login, account and checkout page, how do I fix the product and category pages to be only on HTTP even after currency change? I'm using 1.5.2.1
Re: Currency change causes HTTPS?
Posted: Sun Jun 17, 2012 7:14 pm
by Aladdin
I do have same problem and I have not solved it yet. Hopefully someone shows up with solution post.
I use same version 1.5.2.1
Regards
A.T
Re: Currency change causes HTTPS?
Posted: Tue Jun 19, 2012 11:13 am
by yarac
Is there no solution to this? Is this a bug? Please help.
Re: Currency change causes HTTPS?
Posted: Tue Jun 19, 2012 3:51 pm
by Aladdin
Hi,
Yes, I hope someone helps on this.
If someone is able to solve this issue with Rewrite in htaccess file, it would be great!, I mean to force HTTP on all pages except checkout and account pages. then problem solved!!
I managed to force HTTPS on checkout and account pages but have not yet solved with forcing HTTP on other pages.
I did on htaccess the following;
Code: Select all
# Force SSL non clean url
RewriteCond %{HTTPS} !=on
RewriteCond %{QUERY_STRING} ^(.*)(checkout/checkout|checkout/success|account)
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Regards
A.T
Re: Currency change causes HTTPS?
Posted: Tue Jun 19, 2012 4:38 pm
by Avvici
Just for shits and giggles, open up /catalog/controller/module/currency.php and find this code:
Code: Select all
if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) {
$connection = 'NOSSL';
} else {
$connection = 'SSL';
}
Reverse the connection variable values like this:
Code: Select all
if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) {
$connection = 'SSL';
} else {
$connection = 'NOSSL';
}
Make sure it works with those pages that actually need to be SSL like checkout, register etc...
Re: Currency change causes HTTPS?
Posted: Tue Jun 19, 2012 4:50 pm
by Aladdin
Thanks dude but it didn't work for me..same results. :s
Re: Currency change causes HTTPS?
Posted: Tue Jun 19, 2012 5:16 pm
by Avvici
PMing you
For everyone else experiencing the same issue I will post a solution when it comes.
Re: Currency change causes HTTPS?
Posted: Tue Jun 19, 2012 7:51 pm
by JAY6390
The above solution that Avvici has posted should work, however there is some code that's even simpler that you can use for this. Open up the file above again. Just before this line
Code: Select all
$this->data['redirect'] = $this->url->link($route, $url, $connection);
put
Code: Select all
$connection = empty($_SERVER['HTTPS']) ? 'NONSSL' : 'SSL';
Be sure to check that the file gets saved once you make the change
Re: Currency change causes HTTPS?
Posted: Tue Jun 19, 2012 8:31 pm
by Aladdin
Thank you JAY6390, actually it works now!!!
Added your line code into both ../controller/module/currency.php and ../controller/module/language.php
and problem is now solved! ..no HTTPS anymore when currency/language change.
Regards
A.T
Re: Currency change causes HTTPS?
Posted: Tue Jun 19, 2012 8:36 pm
by JAY6390
Great. Out of interest, did you check that HTTPS pages work correctly maintaining HTTPS?
Re: Currency change causes HTTPS?
Posted: Tue Jun 19, 2012 8:49 pm
by Aladdin
Yup dude..
checkout/account/affilate pages work perfectly fine with this change.
I force HTTPS -htaccess- on these pages anyway. so all good. Thanks again
Re: Currency change causes HTTPS?
Posted: Tue Jun 19, 2012 8:52 pm
by JAY6390
ah ok cool
Re: Currency change causes HTTPS?
Posted: Tue Jun 19, 2012 9:22 pm
by Avvici
Das right, you my biatch doin the dirty work..

Re: Currency change causes HTTPS?
Posted: Wed Jun 20, 2012 8:34 am
by Qphoria
avvici wrote:Das right, you my biatch doin the dirty work..

Fo sho!
Re: [solved] Currency change causes HTTPS?
Posted: Wed Jun 20, 2012 8:36 am
by JAY6390
well someone's got to do some work around here
