Jump to content

How to make Store Locator page as homepage for my shop


Recommended Posts

hello, in this case you need to modify IndexController php file

you need to modify initContent() function, modify it to display store locator (you can copy contents from stores controller)

	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');
	}

don't forget to copy other functions used in code above.

Link to comment
Share on other sites

  • 1 month later...

Hi,

 

I enabled MultiStore and took a copy of StoresController.php and  changed the classname to "IndexControllerCore" and pasted in IndexController.php file. Now It is showing the "Our Stores" page as index page.

 

But this Stores page should be displayed only on my main shop. If I navigate to other shops, It should display the default functionality of Prestashop. Tell me how can i check whether it is main shop or other shop inorder to display the stores / default index page.

 

 

Thanks

Link to comment
Share on other sites

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...