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
Simple menu animé en css3
Nous allons créer une simple animation en css3 sur l'affichage d'une liste. Cela peut être utile pour apporter un peu d'animation sur un menu vertical. Nous allons utiliser la propriété "transition" proposé par...
Refonte WordPress pour Atout Plastic
Un nouveau site web La nouvelle version du site internet d’Atout Plastic est en ligne. Nous remercions monsieur et madame Masson de continuer à nous faire confiance. Le premier site dédié à...