Jump to content

force SSL on all pages: google maps stops working in storelocator


Recommended Posts

Hi,

 

Enabeling "force SSL on all pages" lead to the problem that the google-map at the storelocator stopped working.

 

There is only an empty <div id="map"></div> instead of the map.

With SSL=enabled and "force SSL on all pages"=disabled the storelocator works fine.

 

I would desperately need help with this issue, our shop will go online end of month.

 

Thanks and best regards, Christian

 

 

 

 

Link to comment
Share on other sites

open file:

controllers/front/storesController.php

 

find code:

	public function setMedia()
	{
		parent::setMedia();
		$this->addCSS(_THEME_CSS_DIR_.'stores.css');
		if (!Configuration::get('PS_STORES_SIMPLIFIED'))
			$this->addJS(_THEME_JS_DIR_.'stores.js');
        $default_country = new Country((int)Configuration::get('PS_COUNTRY_DEFAULT'));
		$this->addJS('http://maps.google.com/maps/api/js?sensor=true&region='.substr($default_country->iso_code, 0, 2));
	}

change line:

$this->addJS('http://maps.google.com/maps/api/js?sensor=true&region='.substr($default_country->iso_code, 0, 2));

to

$this->addJS('https://maps.google.com/maps/api/js?sensor=true&region='.substr($default_country->iso_code, 0, 2));
  • Like 1
Link to comment
Share on other sites

$this->addJS('https://maps.google.com/maps/api/js?sensor=true&region='.substr($default_country->iso_code, 0, 2));

 

Hi Vekia,

 

Thanks a lot!

Its working as long as I don't enable CCC for javascript.

 

 

I'v cleared all caches both at the BO and by ftp (cache + /mytheme/cache) and set forced compilation.

 

Maybe there is a peace of code in the CCC that stripes out https ??

 

Best regards, Christian

Edited by cong2013 (see edit history)
Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...
  • 4 weeks later...

Hey all, I was able to get my stores up on the SSL by disabling the module.

Front office Features

Google Maps fix - Store locator v1.0.0 - by Mijn Presta
 
 
it seemed to be putting the api key in the wrong place - see my post here
Link to comment
Share on other sites

×
×
  • Create New...