Dear readers,
Today I will show you how to create a page highlighting one of your shops. This page will include a location map and some practical informations as opening times, the phone number, an e-mail address, the description (etc…).
By default, Prestashop allows you to choose between two views of your page. The first one gathers all your shops in one single Google map interface ; the second one sets your page in a traditional interface showing a list of your shops and gathering all the basic informations related to them without any Google map tool.
Most of the time, I have to create pages for shops that only possess one unique postal address. In this case, I need to create a page that would include a Google Maps tool showing the location of my store but ALSO that would include the standard informations of the shop.
So here are the modifications to apply to get this result :
1 – First you have to override the file : controllers/front/StoresController.php
Copy the file in your folder : override/controllers/front/StoresController.php
Copy and paste this code :
In this file we override the function assignStores(); by adding the possibility to show the same elements that in the simplified view.
2 – Modify the view of the page by editing the file : themes/your-theme/stores.tpl
Find the line where the map is show after the {else} :
In my case, I use Bootstrap to get the new area with its informations before the map for the mobile version but after the map in a right column for the desktop version. So I use class « col-sm-push » and « col-sm-pull ».
I’ve used this modification in our new website « Cliquez-Tapis ». A store where you can by and customize your own carpet with your logo or any other picture.
Pour aller plus loin
API migre sur WORDPRESS 4
Un premier site web développé en 2010 API, spécialiste Portail, Motorisation, Porte de garage à Nantes et dans la région nantaise nous a confié la réalisation de son site web en 2010. Refonte...
Développer « à la main » vs usage d’un CMS
Récemment j’ai rencontré de jeunes développeurs, surtout des purs et durs, des rois du code, aficionados (voir ayatollahs pour certains) du C#, C++, JEE et autres Java, mais aussi du PHP...