cheeseng Posted November 30, 2016 Share Posted November 30, 2016 Hi, I'm new to prestashop 1.7, after i configured my store and key in the longitude and latitude of location of my store, but the map won't show out on the store page. Did i miss something? Anyone can help me. Thank you Link to comment Share on other sites More sharing options...
cheeseng Posted December 4, 2016 Author Share Posted December 4, 2016 Anyone can help to show the google map on prestashop 1.7? thanks Link to comment Share on other sites More sharing options...
w3bsolutions Posted December 4, 2016 Share Posted December 4, 2016 (edited) The Google Map feature on the stores page was removed in PS 1.7. It would have to be programmed or added to the template, or this module will do it for ya: https://addons.prestashop.com/en/product.php?id_product=24709 Edited December 6, 2016 by w3bsolutions (see edit history) 1 Link to comment Share on other sites More sharing options...
bao nam Posted December 5, 2016 Share Posted December 5, 2016 (edited) You can use this code. themes/[your theme]/templates/cms/stores.tpl . After {foreach $stores as $store} <div id='google-maps-{$store.id}' class="google-maps" data-name="{$store.id}" data-label="{$store.name}" data-description="{$store.address.formatted nofilter}" data-value="{$store.latitude},{$store.longitude}"></div> themes/[your theme]/assets/css/theme.css .google-maps { width: 100%; float: left; min-height: 250px; } themes/[your theme]/assets/js/custom.js function init_gmap() { $('.google-maps').each(function(){ map_description = $(this).data('description'); value = $(this).data('value'); value_latlng = value.split(','); name = $(this).data('name'); label = $(this).data('label'); var myOptions = { zoom: 15, center: new google.maps.LatLng(value_latlng[0],value_latlng[1]), mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('google-maps-'+name), myOptions); marker = new google.maps.Marker({ map: map, position: new google.maps.LatLng(value_latlng[0],value_latlng[1]) }); infowindow = new google.maps.InfoWindow({ content: "<strong>"+label+"</strong><br/>"+map_description }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map, marker); }); infowindow.open(map, marker); google.maps.event.trigger(map, "resize"); }); } $(window).load(function() { if($('.google-maps').length > 0){ var script = document.createElement("script"); script.src = "https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback=init_gmap"; script.type = "text/javascript"; document.getElementsByTagName("head")[0].appendChild(script); } }); Edited December 5, 2016 by bao nam (see edit history) 1 Link to comment Share on other sites More sharing options...
w3bsolutions Posted December 6, 2016 Share Posted December 6, 2016 Here is a free module that will do it: https://github.com/ArnaudDx/Google-map-store-page-prestashop-1.7 2 Link to comment Share on other sites More sharing options...
ARQU Posted February 16, 2017 Share Posted February 16, 2017 Here is a free module that will do it: https://github.com/ArnaudDx/Google-map-store-page-prestashop-1.7 Hi w3bsolutions. I've set up the Github module, but it doesn't show stores on the map. Any ideas please? Link to comment Share on other sites More sharing options...
w3bsolutions Posted February 16, 2017 Share Posted February 16, 2017 The official thread of that module is here: https://www.prestashop.com/forums/topic/569711-module-google-map-pour-la-page-magasins-17/ - you can ask developer there. Cheers. Link to comment Share on other sites More sharing options...
marloru Posted March 10, 2021 Share Posted March 10, 2021 On 12/6/2016 at 6:23 PM, w3bsolutions said: Here is a free module that will do it: https://github.com/ArnaudDx/Google-map-store-page-prestashop-1.7 Thank you, it works!!!!! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now