Datta_Storelocator - Version 1.0.1

Version Notes

Updated version for store locator some minor changes.

Download this release

Release Info

Developer Dattatray Yadav
Extension Datta_Storelocator
Version 1.0.1
Comparing to
See all releases


Code changes from version 1.0.0 to 1.0.1

app/code/community/Datta/StoreLocator/Block/Adminhtml/Store/Edit/Form.php CHANGED
@@ -31,7 +31,7 @@ class Datta_StoreLocator_Block_Adminhtml_Store_Edit_Form extends Mage_Adminhtml_
31
  {
32
  /**
33
  * Init class
34
- */
35
  public function __construct()
36
  {
37
  parent::__construct();
31
  {
32
  /**
33
  * Init class
34
+ */
35
  public function __construct()
36
  {
37
  parent::__construct();
app/code/community/Datta/StoreLocator/etc/adminhtml.xml CHANGED
@@ -39,6 +39,11 @@
39
  <sort_order>1</sort_order>
40
  <action>datta_storelocator/adminhtml_store</action>
41
  </datta_storelocator>
 
 
 
 
 
42
  </children>
43
  </datta>
44
  </menu>
39
  <sort_order>1</sort_order>
40
  <action>datta_storelocator/adminhtml_store</action>
41
  </datta_storelocator>
42
+ <configuration>
43
+ <title>Configuration Settings</title>
44
+ <sort_order>100</sort_order>
45
+ <action>adminhtml/system_config/edit/section/storelocator</action>
46
+ </configuration>
47
  </children>
48
  </datta>
49
  </menu>
app/design/frontend/{ecart/ecart-theme → default/default}/layout/datta/storelocator.xml RENAMED
File without changes
app/design/frontend/{ecart/ecart-theme → default/default}/template/datta/storelocator/storelocator.phtml RENAMED
File without changes
js/datta/storelocator.js ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package Datta_StoreLocator
23
+ * @created Dattatray Yadav 2nd Dec,2013 3:58pm
24
+ * @author Clarion magento team<Dattatray Yadav>
25
+ * @purpose Store locator google api js
26
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
27
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License
28
+ */
29
+
30
+ var markerVisitor = false;
31
+ function initialize(){
32
+ bounds = new google.maps.LatLngBounds();
33
+ var mapOption = {zoom: 22, mapTypeId: google.maps.MapTypeId.ROADMAP, disableDefaultUI : true , zoomControl : true};
34
+ map = new google.maps.Map(document.getElementById('map_canvas'), mapOption);
35
+ direction = new google.maps.DirectionsRenderer({
36
+ map : map,
37
+ panel : document.getElementById('panel'),
38
+ suppressMarkers : true
39
+ });
40
+ autocomplete = new google.maps.places.Autocomplete($("address"));
41
+ google.maps.event.addListener(autocomplete, 'place_changed', autocompleteCallback);
42
+
43
+ infoWindow = new google.maps.InfoWindow();
44
+ initGeoloc();
45
+ initStores();
46
+ }
47
+ function getItineraire(lat, lng ){
48
+ var destination = new google.maps.LatLng(lat, lng);
49
+ if(markerVisitor){
50
+ var origin = markerVisitor.getPosition();
51
+ var request = {
52
+ origin : origin,
53
+ destination : destination,
54
+ travelMode : google.maps.DirectionsTravelMode.DRIVING
55
+ }
56
+ var directionsService = new google.maps.DirectionsService();
57
+ directionsService.route(request, function(response, status){
58
+ if(status == google.maps.DirectionsStatus.OK){
59
+ direction.setDirections(response);
60
+ }
61
+ });
62
+ }
63
+
64
+ }
65
+ function getMyLatLng(){
66
+ if(navigator.geolocation){
67
+ navigator.geolocation.getCurrentPosition(function(position){
68
+ var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
69
+ }, erreurPosition);
70
+ return latlng;
71
+ }
72
+ }
73
+ function loadScript() {
74
+ var script = document.createElement("script");
75
+ script.type = "text/javascript";
76
+ script.src = gmapUrl;
77
+ document.body.appendChild(script);
78
+ }
79
+ function initGeoloc(){
80
+ if(apiSensor){
81
+ if(navigator.geolocation) {
82
+ survId = navigator.geolocation.getCurrentPosition(maPosition,erreurPosition);
83
+ }
84
+ }
85
+ }
86
+ function maPosition(position) {
87
+ latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
88
+ markerPosition(latlng);
89
+ }
90
+ function erreurPosition(error) {
91
+ var info = "Erreur lors de la géolocalisation : ";
92
+ switch(error.code) {
93
+ case error.TIMEOUT:
94
+ info += "Timeout !";
95
+ break;
96
+ case error.PERMISSION_DENIED:
97
+ info += "Vous n’avez pas donné la permission";
98
+ break;
99
+ case error.POSITION_UNAVAILABLE:
100
+ info += "La position n’a pu être déterminée";
101
+ break;
102
+ case error.UNKNOWN_ERROR:
103
+ info += "Erreur inconnue";
104
+ break;
105
+ }
106
+ }
107
+ function initStores(){
108
+ markers = new Array();
109
+ var shape = {
110
+ coord: [1, 1, 1, 20, 18, 20, 18 , 1],
111
+ type: 'poly'
112
+ };
113
+ for(i=0; i< stores.items.length; i++){
114
+ var latLng = new google.maps.LatLng(stores.items[i].lat, stores.items[i].long);
115
+ bounds.extend(latLng);
116
+ if(stores.items[i].marker){
117
+ var imgMarker = new google.maps.MarkerImage(pathMarker+stores.items[i].marker);
118
+ }else{
119
+ if(defaultMarker){
120
+ var imgMarker = new google.maps.MarkerImage(pathMarker+defaultMarker);
121
+ }else{
122
+ var imgMarker = '';
123
+ }
124
+ }
125
+
126
+ markers[i] = new google.maps.Marker({position: latLng, icon: imgMarker,map: map,shape: shape, store: stores.items[i]});
127
+ google.maps.event.addListener(markers[i], 'click', openWindowInfo);
128
+ $('store'+stores.items[i].entity_id).observe('click', openWindowInfo.bind(markers[i]));
129
+ }
130
+ map.fitBounds(bounds);
131
+ map.panToBounds(bounds);
132
+ }
133
+ function openWindowInfo(){
134
+ if(!this.store.image){
135
+ this.store.image = defaultImage;
136
+ }
137
+ var content = '<div class="store-info"><div class="store-image-div-infoWindow"><img src="'+this.store.image +'" alt="'+this.store.name+'"class="store-image-infoWindow"/></div><div class="store-name-infoWindow"><h3>' + this.store.name + '</h3>'
138
+ + this.store.address + '<br>'
139
+ + this.store.zipcode+' '+ this.store.city +' <br>'+ this.store.country_id + '<br>';
140
+
141
+ if(this.store.phone){
142
+ content += 'Phone : '+ this.store.phone + '<br>'
143
+ }
144
+
145
+ if(this.store.fax){
146
+ content += 'Fax : '+ this.store.fax + '<br>'
147
+ }
148
+ content += "</div>";
149
+ if(this.store.description){
150
+ content += '<div class="store-description">'+ this.store.description+'</div>';
151
+ }
152
+
153
+ if(markerVisitor && directionEnable){
154
+ content += '<span onclick="getItineraire('+this.store.lat+','+ this.store.long+')" class="span-geoloc">'+estimateDirectionLabel+'</span></div></div>';
155
+ }
156
+
157
+ infoWindow.setContent(content);
158
+ infoWindow.open(map,this);
159
+ }
160
+
161
+ function autocompleteCallback(){
162
+ var place = this.getPlace();
163
+ position = place.geometry.location;
164
+ var latLng = new google.maps.LatLng(position.lat(), position.lng());
165
+ markerPosition(latLng);
166
+ }
167
+
168
+ function markerPosition(latlng){
169
+ bounds.extend(latlng);
170
+ if(markerVisitor){
171
+ markerVisitor.setPosition(latlng);
172
+ }else{
173
+ markerVisitor = new google.maps.Marker({
174
+ position: latlng,
175
+ map: map,
176
+ title:"Vous êtes ici"
177
+ });
178
+ }
179
+ map.panTo(latlng);
180
+ map.setZoom(12);
181
+ }
package.xml CHANGED
@@ -1,30 +1,35 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Datta_Storelocator</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Store locator allow to locate multiple stores on the Google map. It allow to administrator to add multiple store locations and allow point/mark to exact store location on the Google map. It will store the longitude and latitude and it will displayed store location's based on the back end stored information on the front end. Visitors can able to view store location on the Google map. </summary>
10
- <description>Store locator is extension which allow to add multiple store locations using admin back end panel and map them on the Google map. This extension is provide the system configuration settings in configuration "system-&gt;store locator setting -&gt; store locator" for store locator. In the store locator configuration setting you need to add Google API URL and your API key. It will also allow you to upload default store image and custom marker image. Once you add the required information in you can able to see the able to see the Google map on the store location page on the front end. &#xD;
11
- After the configuration settings admin can able add your multiple store location's using &#xD;
12
- Store location -&gt; store locator using this link. It show the existing store location's in grid. From here admin can able to add new store location or edit existing store information. while adding/editing the store information you need enter the required information. once add required information and make status enabled, store will displayed on the front end store location page on Google map. if visitor click on the Google map marker it will show the store location information with store image on Google map in window info.&#xD;
13
  &#xD;
14
- This extension help you to manage your different store locations. &#xD;
15
- Key features : &#xD;
16
  &#xD;
17
- 1. Store location will show on the Google map by using added information by the admin user. Admin needs to add store location information like store name, address, URL, city etc. According to entered information location will get detected and it will show the marker on map. Admin can able to move the marker and longitude, latitude will change. Once admin save that information that will show on the map in front end site. While adding the store information there are some fields are mandatory like Store name, address, city, zip code, longitude, latitude etc. &#xD;
18
- 2. Upload default store image and marker image. &#xD;
19
- 3. Show store location image and information &#xD;
20
- 4. Import and export information&#xD;
21
- 5. List the all the stores in admin&#xD;
22
- 6. Update store information </description>
23
- <notes>Store locator first version release </notes>
 
 
 
 
 
 
24
  <authors><author><name>Dattatray Yadav</name><user>dattayadav03</user><email>dattayadav03@gmail.com</email></author></authors>
25
- <date>2014-03-25</date>
26
- <time>11:56:44</time>
27
- <contents><target name="magecommunity"><dir name="Datta"><dir name="StoreLocator"><dir name="Block"><dir name="Adminhtml"><dir name="Store"><dir name="Edit"><file name="Form.php" hash="4bf4e8951279211807fbaeb1ff2a97d7"/></dir><file name="Edit.php" hash="2ae32758ca81f7c47790023cc6d8a558"/><file name="Grid.php" hash="0c58a303f570760f0477b0f661a3d198"/><dir name="Renderer"><file name="Image.php" hash="5ab6acbed99dcfb852b5d644ea53a31d"/></dir></dir><file name="Store.php" hash="bab97951f1408a85fd74160f68fa7447"/></dir><file name="Store.php" hash="56753219f6e4c69b6fd0473345996ac7"/></dir><dir name="Helper"><file name="Data.php" hash="16463dae2226743497e40cf743f84fe2"/></dir><dir name="Model"><dir name="Resource"><dir name="Store"><file name="Collection.php" hash="9114d3e7127817bee44f32af005b9b47"/></dir><file name="Store.php" hash="3d7ac08d07de2aa0b22e11270b749592"/></dir><file name="Store.php" hash="c36f7e03dbeaad6338260bba74f2856a"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="Image.php" hash="ec1a473d1042c5308c4685bdda5142f3"/><file name="Marker.php" hash="81e54be1873f6f980ffb5623032b9fc8"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="StoreController.php" hash="ed45a27403e6599fe1a4a280fa120a75"/></dir><file name="IndexController.php" hash="7fbb2ecb94e3c7b27d5efc9ce8128073"/></dir><dir name="etc"><file name="adminhtml.xml" hash="4ff449806654eb1c23c5f909af233f35"/><file name="config.xml" hash="c16424d85cedd0573f387c44c862d7f0"/><file name="system.xml" hash="0fc751f3b1900656d8e73031966fdd9f"/></dir><dir name="sql"><dir name="datta_storelocator_setup"><file name="mysql4-install-1.0.0.php" hash="b8812323bbd7df1a525e478aa9b3326f"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Datta_Storelocator.xml" hash="69e2689303be1bcd9e96acc52c0943b2"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="ecart"><dir name="ecart-theme"><dir name="template"><dir name="datta"><dir name="storelocator"><file name="storelocator.phtml" hash="99d502aad0039f3a0fffb7c1784c3cd5"/></dir></dir></dir><dir name="layout"><dir name="datta"><file name="storelocator.xml" hash="13daac525666f1ff8a7e5ea963da29ed"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="datta"><file name="storelocator.xml" hash="645704ed2ce741c83a7ac12e0442ccf7"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="ecart"><dir name="ecart-theme"><dir name="css"><dir name="datta"><file name="storelocator.css" hash="3bbf7b1580b432670bee84a529b294d0"/></dir></dir></dir></dir></dir></target></contents>
28
  <compatible/>
29
  <dependencies><required><php><min>1.0.0</min><max>9.9.99</max></php></required></dependencies>
30
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Datta_Storelocator</name>
4
+ <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>It shows store location's on Google map based on stored information in back end.</summary>
10
+ <description>Store locator is extension which allow to add multiple store locations using admin back end panel and map them on the Google map. &lt;br /&gt;This extension is provide the system configuration settings in configuration "system-&gt;store locator setting -&gt; store locator" for store locator. In the store locator configuration setting you need to add Google API URL and your API key. It will also allow you to upload default store image and custom marker image. Once you add the &#xD;
11
+ required information in you can able to see the able to see the Google map on the store location page on the front end. &#xD;
12
+ After the configuration settings admin can able add your multiple store location's using Store location -&gt; store locator using this link. It show the existing store location's in &#xD;
13
  &#xD;
14
+ grid. From here admin can able to add new store location or edit existing store information. &#xD;
 
15
  &#xD;
16
+ while adding/editing the store information you need enter the required information. once add required information and make status enabled, store will displayed on the front end store location page on Google map. if visitor click on the Google map marker it will show the store location information with store image on Google map in window info.&lt;br /&gt;&lt;br /&gt;&#xD;
17
+ This extension help you to manage your different store locations. &#xD;
18
+ &lt;br /&gt;&#xD;
19
+ Key features : &lt;br /&gt;&#xD;
20
+ 1. Store location will show on the Google map by using added information by the admin user. Admin needs to add store location information like store name, address, URL, city etc. &#xD;
21
+ According to entered information location will get detected and it will show the marker on map. Admin can able to move the marker and longitude, latitude will change. Once admin save&#xD;
22
+ that information that will show on the map in front end site. While adding the store information there are some fields are mandatory like Store name, address, city, zip code, longitude, latitude etc. &lt;br /&gt; &lt;br /&gt;&#xD;
23
+ 2. Upload default store image and marker image. &lt;br /&gt;&lt;br /&gt;&#xD;
24
+ 3. Show store location image and information &lt;br /&gt;&lt;br /&gt;&#xD;
25
+ 4. Import and export information&lt;br /&gt;&lt;br /&gt;&#xD;
26
+ 5. List the all the stores in admin&lt;br /&gt;&lt;br /&gt;&#xD;
27
+ 6. Update store information </description>
28
+ <notes>Updated version for store locator some minor changes. </notes>
29
  <authors><author><name>Dattatray Yadav</name><user>dattayadav03</user><email>dattayadav03@gmail.com</email></author></authors>
30
+ <date>2014-03-28</date>
31
+ <time>13:04:31</time>
32
+ <contents><target name="magecommunity"><dir name="Datta"><dir name="StoreLocator"><dir name="Block"><dir name="Adminhtml"><dir name="Store"><dir name="Edit"><file name="Form.php" hash="240de144bba4f8b4ac5b944c07a8ce34"/></dir><file name="Edit.php" hash="2ae32758ca81f7c47790023cc6d8a558"/><file name="Grid.php" hash="0c58a303f570760f0477b0f661a3d198"/><dir name="Renderer"><file name="Image.php" hash="5ab6acbed99dcfb852b5d644ea53a31d"/></dir></dir><file name="Store.php" hash="bab97951f1408a85fd74160f68fa7447"/></dir><file name="Store.php" hash="56753219f6e4c69b6fd0473345996ac7"/></dir><dir name="Helper"><file name="Data.php" hash="16463dae2226743497e40cf743f84fe2"/></dir><dir name="Model"><dir name="Resource"><dir name="Store"><file name="Collection.php" hash="9114d3e7127817bee44f32af005b9b47"/></dir><file name="Store.php" hash="3d7ac08d07de2aa0b22e11270b749592"/></dir><file name="Store.php" hash="c36f7e03dbeaad6338260bba74f2856a"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="Image.php" hash="ec1a473d1042c5308c4685bdda5142f3"/><file name="Marker.php" hash="81e54be1873f6f980ffb5623032b9fc8"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="StoreController.php" hash="ed45a27403e6599fe1a4a280fa120a75"/></dir><file name="IndexController.php" hash="7fbb2ecb94e3c7b27d5efc9ce8128073"/></dir><dir name="etc"><file name="adminhtml.xml" hash="04b2baf72a4c774123ccba08a59187fb"/><file name="config.xml" hash="c16424d85cedd0573f387c44c862d7f0"/><file name="system.xml" hash="0fc751f3b1900656d8e73031966fdd9f"/></dir><dir name="sql"><dir name="datta_storelocator_setup"><file name="mysql4-install-1.0.0.php" hash="b8812323bbd7df1a525e478aa9b3326f"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Datta_Storelocator.xml" hash="69e2689303be1bcd9e96acc52c0943b2"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="datta"><file name="storelocator.xml" hash="645704ed2ce741c83a7ac12e0442ccf7"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="datta"><dir name="storelocator"><file name="storelocator.phtml" hash="99d502aad0039f3a0fffb7c1784c3cd5"/></dir></dir></dir><dir name="layout"><dir name="datta"><file name="storelocator.xml" hash="13daac525666f1ff8a7e5ea963da29ed"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="datta"><file name="storelocator.js" hash="c108e52509e9287eecbadfd7bceebf52"/></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><dir name="datta"><file name="storelocator.css" hash="3bbf7b1580b432670bee84a529b294d0"/></dir></dir></dir></dir></dir></target></contents>
33
  <compatible/>
34
  <dependencies><required><php><min>1.0.0</min><max>9.9.99</max></php></required></dependencies>
35
  </package>
skin/frontend/{ecart/ecart-theme → default/default}/css/datta/storelocator.css RENAMED
File without changes