Jump to content

Show both Google Map and Stores in "Our Stores"


NicePack

Recommended Posts

Hi, I'm using P1.6 and I've seen that it's back office allows me to show "Our Stores" page in two different ways:

 

1) A list of my saved stores

-or-

2) A Google Map with a search box with my stores located in there. And if I search some location it shows a list with the stores in location.

 

But is there a way (or module) to show both map and list without searching?

 

I've seen that in stores.tpl there's an If statement that chooses between map or "list" I tried to merge all code lines oustside list but it doesn't work. It have priority what I've chosen in the backoffice options.

 

If it's usefull some example I would do something like this: http://www.lamallorquina.es/en/content/6-shops (also in this example you can pick the name of a shop and it shows in the map but I think that this is a futur problem that I'll have to fight :P)

 

Any suggestion? Thanks!

Link to comment
Share on other sites

Ok, if I'm not wrong it seem that I must change something in StoresControlles.php. I've seen this code:

	public function initContent()
	{
		parent::initContent();

		if (Configuration::get('PS_STORES_SIMPLIFIED'))
			$this->assignStoresSimplified();
		else
			$this->assignStores();

		$this->context->smarty->assign(array(
			'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
			'defaultLat' => (float)Configuration::get('PS_STORES_CENTER_LAT'),
			'defaultLong' => (float)Configuration::get('PS_STORES_CENTER_LONG'),
			'searchUrl' => $this->context->link->getPageLink('stores'),
			'logo_store' => Configuration::get('PS_STORES_ICON')
		));

		$this->setTemplate(_PS_THEME_DIR_.'stores.tpl');
	}

I think that if I Kill this If statement and assing $this->assignStores(); I'll get one unique result. But don't know how to get map and stores list in assignStores() function :(

 

Well to be fair I'm not sure if that's the solution. I'll keep looking for it.

Link to comment
Share on other sites

  • 2 weeks later...
  • 6 months later...
  • 1 year later...
  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...