Version Notes
Magento Store locator extension provides you the best solution to easily set up and reference all your physical stores using the google Map API.
Magento Store locator is easy to install and set up.
Download this release
Release Info
Developer | mukesh kumar saini |
Extension | Mks_Storelocator |
Version | 1.1.1 |
Comparing to | |
See all releases |
Version 1.1.1
- app/code/community/Mks/Storelocator/Block/Adminhtml/Storelocator.php +17 -0
- app/code/community/Mks/Storelocator/Block/Adminhtml/Storelocator/Edit.php +44 -0
- app/code/community/Mks/Storelocator/Block/Adminhtml/Storelocator/Edit/Form.php +17 -0
- app/code/community/Mks/Storelocator/Block/Adminhtml/Storelocator/Edit/Tab/Form.php +93 -0
- app/code/community/Mks/Storelocator/Block/Adminhtml/Storelocator/Edit/Tabs.php +21 -0
- app/code/community/Mks/Storelocator/Block/Adminhtml/Storelocator/Grid.php +118 -0
- app/code/community/Mks/Storelocator/Block/Adminhtml/Storelocatorbackend.php +5 -0
- app/code/community/Mks/Storelocator/Block/Index.php +8 -0
- app/code/community/Mks/Storelocator/Helper/Data.php +5 -0
- app/code/community/Mks/Storelocator/Model/Mysql4/Storelocator.php +8 -0
- app/code/community/Mks/Storelocator/Model/Mysql4/Storelocator/Collection.php +12 -0
- app/code/community/Mks/Storelocator/Model/Storelocator.php +12 -0
- app/code/community/Mks/Storelocator/controllers/Adminhtml/StorelocatorController.php +253 -0
- app/code/community/Mks/Storelocator/controllers/Adminhtml/StorelocatorbackendController.php +10 -0
- app/code/community/Mks/Storelocator/controllers/IndexController.php +22 -0
- app/code/community/Mks/Storelocator/etc/config.xml +134 -0
- app/code/community/Mks/Storelocator/sql/storelocator_setup/mysql4-install-1.1.1.php +14 -0
- app/design/adminhtml/default/default/layout/storelocator.xml +13 -0
- app/design/adminhtml/default/default/template/storelocator/storelocatorbackend.phtml +13 -0
- app/design/frontend/base/default/layout/storelocator.xml +12 -0
- app/design/frontend/base/default/template/storelocator/index.phtml +91 -0
- app/etc/modules/Mks_Storelocator.xml +10 -0
- package.xml +20 -0
app/code/community/Mks/Storelocator/Block/Adminhtml/Storelocator.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
class Mks_Storelocator_Block_Adminhtml_Storelocator extends Mage_Adminhtml_Block_Widget_Grid_Container{
|
5 |
+
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
+
|
9 |
+
$this->_controller = "adminhtml_storelocator";
|
10 |
+
$this->_blockGroup = "storelocator";
|
11 |
+
$this->_headerText = Mage::helper("storelocator")->__("Storelocator Manager");
|
12 |
+
$this->_addButtonLabel = Mage::helper("storelocator")->__("Add New Item");
|
13 |
+
parent::__construct();
|
14 |
+
|
15 |
+
}
|
16 |
+
|
17 |
+
}
|
app/code/community/Mks/Storelocator/Block/Adminhtml/Storelocator/Edit.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mks_Storelocator_Block_Adminhtml_Storelocator_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
|
8 |
+
parent::__construct();
|
9 |
+
$this->_objectId = "id";
|
10 |
+
$this->_blockGroup = "storelocator";
|
11 |
+
$this->_controller = "adminhtml_storelocator";
|
12 |
+
$this->_updateButton("save", "label", Mage::helper("storelocator")->__("Save Item"));
|
13 |
+
$this->_updateButton("delete", "label", Mage::helper("storelocator")->__("Delete Item"));
|
14 |
+
|
15 |
+
$this->_addButton("saveandcontinue", array(
|
16 |
+
"label" => Mage::helper("storelocator")->__("Save And Continue Edit"),
|
17 |
+
"onclick" => "saveAndContinueEdit()",
|
18 |
+
"class" => "save",
|
19 |
+
), -100);
|
20 |
+
|
21 |
+
|
22 |
+
|
23 |
+
$this->_formScripts[] = "
|
24 |
+
|
25 |
+
function saveAndContinueEdit(){
|
26 |
+
editForm.submit($('edit_form').action+'back/edit/');
|
27 |
+
}
|
28 |
+
";
|
29 |
+
}
|
30 |
+
|
31 |
+
public function getHeaderText()
|
32 |
+
{
|
33 |
+
if( Mage::registry("storelocator_data") && Mage::registry("storelocator_data")->getId() ){
|
34 |
+
|
35 |
+
return Mage::helper("storelocator")->__("Edit Item '%s'", $this->htmlEscape(Mage::registry("storelocator_data")->getId()));
|
36 |
+
|
37 |
+
}
|
38 |
+
else{
|
39 |
+
|
40 |
+
return Mage::helper("storelocator")->__("Add Item");
|
41 |
+
|
42 |
+
}
|
43 |
+
}
|
44 |
+
}
|
app/code/community/Mks/Storelocator/Block/Adminhtml/Storelocator/Edit/Form.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Mks_Storelocator_Block_Adminhtml_Storelocator_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
3 |
+
{
|
4 |
+
protected function _prepareForm()
|
5 |
+
{
|
6 |
+
$form = new Varien_Data_Form(array(
|
7 |
+
"id" => "edit_form",
|
8 |
+
"action" => $this->getUrl("*/*/save", array("id" => $this->getRequest()->getParam("id"))),
|
9 |
+
"method" => "post",
|
10 |
+
"enctype" =>"multipart/form-data",
|
11 |
+
)
|
12 |
+
);
|
13 |
+
$form->setUseContainer(true);
|
14 |
+
$this->setForm($form);
|
15 |
+
return parent::_prepareForm();
|
16 |
+
}
|
17 |
+
}
|
app/code/community/Mks/Storelocator/Block/Adminhtml/Storelocator/Edit/Tab/Form.php
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Mks_Storelocator_Block_Adminhtml_Storelocator_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
3 |
+
{
|
4 |
+
protected function _prepareForm()
|
5 |
+
{
|
6 |
+
|
7 |
+
$form = new Varien_Data_Form();
|
8 |
+
$this->setForm($form);
|
9 |
+
$fieldset = $form->addFieldset("storelocator_form", array("legend"=>Mage::helper("storelocator")->__("Item information")));
|
10 |
+
|
11 |
+
|
12 |
+
$fieldset->addField("name", "text", array(
|
13 |
+
"label" => Mage::helper("storelocator")->__("Name"),
|
14 |
+
"name" => "name",
|
15 |
+
));
|
16 |
+
|
17 |
+
$fieldset->addField("address", "textarea", array(
|
18 |
+
"label" => Mage::helper("storelocator")->__("Address"),
|
19 |
+
"name" => "address",
|
20 |
+
));
|
21 |
+
|
22 |
+
$fieldset->addField("zipcode", "text", array(
|
23 |
+
"label" => Mage::helper("storelocator")->__("Zipcode"),
|
24 |
+
"name" => "zipcode",
|
25 |
+
));
|
26 |
+
|
27 |
+
$fieldset->addField("city", "text", array(
|
28 |
+
"label" => Mage::helper("storelocator")->__("City"),
|
29 |
+
"name" => "city",
|
30 |
+
));
|
31 |
+
|
32 |
+
$fieldset->addField("country_id", "text", array(
|
33 |
+
"label" => Mage::helper("storelocator")->__("Country Name"),
|
34 |
+
"name" => "country_id",
|
35 |
+
));
|
36 |
+
|
37 |
+
$fieldset->addField("phone", "text", array(
|
38 |
+
"label" => Mage::helper("storelocator")->__("Phone"),
|
39 |
+
"name" => "phone",
|
40 |
+
));
|
41 |
+
|
42 |
+
$fieldset->addField("fax", "text", array(
|
43 |
+
"label" => Mage::helper("storelocator")->__("Fax"),
|
44 |
+
"name" => "fax",
|
45 |
+
));
|
46 |
+
|
47 |
+
$fieldset->addField("description", "textarea", array(
|
48 |
+
"label" => Mage::helper("storelocator")->__("Description"),
|
49 |
+
"name" => "description",
|
50 |
+
));
|
51 |
+
|
52 |
+
$fieldset->addField("store_url", "text", array(
|
53 |
+
"label" => Mage::helper("storelocator")->__("Store Url"),
|
54 |
+
"name" => "store_url",
|
55 |
+
));
|
56 |
+
|
57 |
+
$fieldset->addField('image', 'image', array(
|
58 |
+
'label' => Mage::helper('storelocator')->__('Image'),
|
59 |
+
'name' => 'image',
|
60 |
+
'note' => '(*.jpg, *.png, *.gif)',
|
61 |
+
));
|
62 |
+
$fieldset->addField('marker', 'image', array(
|
63 |
+
'label' => Mage::helper('storelocator')->__('Marker Image'),
|
64 |
+
'name' => 'marker',
|
65 |
+
'note' => '(*.jpg, *.png, *.gif)',
|
66 |
+
));
|
67 |
+
$fieldset->addField("lat", "text", array(
|
68 |
+
"label" => Mage::helper("storelocator")->__("Latitude"),
|
69 |
+
"name" => "lat",
|
70 |
+
));
|
71 |
+
|
72 |
+
$fieldset->addField("longt", "text", array(
|
73 |
+
"label" => Mage::helper("storelocator")->__("Longitude"),
|
74 |
+
"name" => "longt",
|
75 |
+
));
|
76 |
+
|
77 |
+
$fieldset->addField('status', 'select', array(
|
78 |
+
'label' => Mage::helper('storelocator')->__('Status'),
|
79 |
+
'values' => Mks_Storelocator_Block_Adminhtml_Storelocator_Grid::getValueArray13(),
|
80 |
+
'name' => 'status',
|
81 |
+
));
|
82 |
+
|
83 |
+
if (Mage::getSingleton("adminhtml/session")->getStorelocatorData())
|
84 |
+
{
|
85 |
+
$form->setValues(Mage::getSingleton("adminhtml/session")->getStorelocatorData());
|
86 |
+
Mage::getSingleton("adminhtml/session")->setStorelocatorData(null);
|
87 |
+
}
|
88 |
+
elseif(Mage::registry("storelocator_data")) {
|
89 |
+
$form->setValues(Mage::registry("storelocator_data")->getData());
|
90 |
+
}
|
91 |
+
return parent::_prepareForm();
|
92 |
+
}
|
93 |
+
}
|
app/code/community/Mks/Storelocator/Block/Adminhtml/Storelocator/Edit/Tabs.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Mks_Storelocator_Block_Adminhtml_Storelocator_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
parent::__construct();
|
7 |
+
$this->setId("storelocator_tabs");
|
8 |
+
$this->setDestElementId("edit_form");
|
9 |
+
$this->setTitle(Mage::helper("storelocator")->__("Item Information"));
|
10 |
+
}
|
11 |
+
protected function _beforeToHtml()
|
12 |
+
{
|
13 |
+
$this->addTab("form_section", array(
|
14 |
+
"label" => Mage::helper("storelocator")->__("Item Information"),
|
15 |
+
"title" => Mage::helper("storelocator")->__("Item Information"),
|
16 |
+
"content" => $this->getLayout()->createBlock("storelocator/adminhtml_storelocator_edit_tab_form")->toHtml(),
|
17 |
+
));
|
18 |
+
return parent::_beforeToHtml();
|
19 |
+
}
|
20 |
+
|
21 |
+
}
|
app/code/community/Mks/Storelocator/Block/Adminhtml/Storelocator/Grid.php
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mks_Storelocator_Block_Adminhtml_Storelocator_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
+
{
|
5 |
+
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
+
parent::__construct();
|
9 |
+
$this->setId("storelocatorGrid");
|
10 |
+
$this->setDefaultSort("id");
|
11 |
+
$this->setDefaultDir("ASC");
|
12 |
+
$this->setSaveParametersInSession(true);
|
13 |
+
}
|
14 |
+
|
15 |
+
protected function _prepareCollection()
|
16 |
+
{
|
17 |
+
$collection = Mage::getModel("storelocator/storelocator")->getCollection();
|
18 |
+
$this->setCollection($collection);
|
19 |
+
return parent::_prepareCollection();
|
20 |
+
}
|
21 |
+
protected function _prepareColumns()
|
22 |
+
{
|
23 |
+
$this->addColumn("id", array(
|
24 |
+
"header" => Mage::helper("storelocator")->__("ID"),
|
25 |
+
"align" =>"right",
|
26 |
+
"width" => "50px",
|
27 |
+
"type" => "number",
|
28 |
+
"index" => "id",
|
29 |
+
));
|
30 |
+
|
31 |
+
$this->addColumn("name", array(
|
32 |
+
"header" => Mage::helper("storelocator")->__("Name"),
|
33 |
+
"index" => "name",
|
34 |
+
));
|
35 |
+
$this->addColumn("zipcode", array(
|
36 |
+
"header" => Mage::helper("storelocator")->__("Zipcode"),
|
37 |
+
"index" => "zipcode",
|
38 |
+
));
|
39 |
+
$this->addColumn("city", array(
|
40 |
+
"header" => Mage::helper("storelocator")->__("City"),
|
41 |
+
"index" => "city",
|
42 |
+
));
|
43 |
+
$this->addColumn("country_id", array(
|
44 |
+
"header" => Mage::helper("storelocator")->__("Country Name"),
|
45 |
+
"index" => "country_id",
|
46 |
+
));
|
47 |
+
$this->addColumn("phone", array(
|
48 |
+
"header" => Mage::helper("storelocator")->__("Phone"),
|
49 |
+
"index" => "phone",
|
50 |
+
));
|
51 |
+
$this->addColumn("fax", array(
|
52 |
+
"header" => Mage::helper("storelocator")->__("Fax"),
|
53 |
+
"index" => "fax",
|
54 |
+
));
|
55 |
+
$this->addColumn("store_url", array(
|
56 |
+
"header" => Mage::helper("storelocator")->__("Store Url"),
|
57 |
+
"index" => "store_url",
|
58 |
+
));
|
59 |
+
$this->addColumn("lat", array(
|
60 |
+
"header" => Mage::helper("storelocator")->__("Latitude"),
|
61 |
+
"index" => "lat",
|
62 |
+
));
|
63 |
+
$this->addColumn("longt", array(
|
64 |
+
"header" => Mage::helper("storelocator")->__("Longitude"),
|
65 |
+
"index" => "longt",
|
66 |
+
));
|
67 |
+
$this->addColumn('status', array(
|
68 |
+
'header' => Mage::helper('storelocator')->__('Status'),
|
69 |
+
'index' => 'status',
|
70 |
+
'type' => 'options',
|
71 |
+
'options'=>Mks_Storelocator_Block_Adminhtml_Storelocator_Grid::getOptionArray13(),
|
72 |
+
));
|
73 |
+
|
74 |
+
$this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));
|
75 |
+
$this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel'));
|
76 |
+
|
77 |
+
return parent::_prepareColumns();
|
78 |
+
}
|
79 |
+
|
80 |
+
public function getRowUrl($row)
|
81 |
+
{
|
82 |
+
return $this->getUrl("*/*/edit", array("id" => $row->getId()));
|
83 |
+
}
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
protected function _prepareMassaction()
|
88 |
+
{
|
89 |
+
$this->setMassactionIdField('id');
|
90 |
+
$this->getMassactionBlock()->setFormFieldName('ids');
|
91 |
+
$this->getMassactionBlock()->setUseSelectAll(true);
|
92 |
+
$this->getMassactionBlock()->addItem('remove_storelocator', array(
|
93 |
+
'label'=> Mage::helper('storelocator')->__('Remove Storelocator'),
|
94 |
+
'url' => $this->getUrl('*/adminhtml_storelocator/massRemove'),
|
95 |
+
'confirm' => Mage::helper('storelocator')->__('Are you sure?')
|
96 |
+
));
|
97 |
+
return $this;
|
98 |
+
}
|
99 |
+
|
100 |
+
static public function getOptionArray13()
|
101 |
+
{
|
102 |
+
$data_array=array();
|
103 |
+
$data_array[0]='Yes';
|
104 |
+
$data_array[1]='No';
|
105 |
+
return($data_array);
|
106 |
+
}
|
107 |
+
static public function getValueArray13()
|
108 |
+
{
|
109 |
+
$data_array=array();
|
110 |
+
foreach(Mks_Storelocator_Block_Adminhtml_Storelocator_Grid::getOptionArray13() as $k=>$v){
|
111 |
+
$data_array[]=array('value'=>$k,'label'=>$v);
|
112 |
+
}
|
113 |
+
return($data_array);
|
114 |
+
|
115 |
+
}
|
116 |
+
|
117 |
+
|
118 |
+
}
|
app/code/community/Mks/Storelocator/Block/Adminhtml/Storelocatorbackend.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mks_Storelocator_Block_Adminhtml_Storelocatorbackend extends Mage_Adminhtml_Block_Template {
|
4 |
+
|
5 |
+
}
|
app/code/community/Mks/Storelocator/Block/Index.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Mks_Storelocator_Block_Index extends Mage_Core_Block_Template{
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
}
|
app/code/community/Mks/Storelocator/Helper/Data.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Mks_Storelocator_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
}
|
5 |
+
|
app/code/community/Mks/Storelocator/Model/Mysql4/Storelocator.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Mks_Storelocator_Model_Mysql4_Storelocator extends Mage_Core_Model_Mysql4_Abstract
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
$this->_init("storelocator/storelocator", "id");
|
7 |
+
}
|
8 |
+
}
|
app/code/community/Mks/Storelocator/Model/Mysql4/Storelocator/Collection.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Mks_Storelocator_Model_Mysql4_Storelocator_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
3 |
+
{
|
4 |
+
|
5 |
+
public function _construct(){
|
6 |
+
$this->_init("storelocator/storelocator");
|
7 |
+
}
|
8 |
+
|
9 |
+
|
10 |
+
|
11 |
+
}
|
12 |
+
|
app/code/community/Mks/Storelocator/Model/Storelocator.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mks_Storelocator_Model_Storelocator extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct(){
|
6 |
+
|
7 |
+
$this->_init("storelocator/storelocator");
|
8 |
+
|
9 |
+
}
|
10 |
+
|
11 |
+
}
|
12 |
+
|
app/code/community/Mks/Storelocator/controllers/Adminhtml/StorelocatorController.php
ADDED
@@ -0,0 +1,253 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mks_Storelocator_Adminhtml_StorelocatorController extends Mage_Adminhtml_Controller_Action
|
4 |
+
{
|
5 |
+
protected function _initAction()
|
6 |
+
{
|
7 |
+
$this->loadLayout()->_setActiveMenu("storelocator/storelocator")->_addBreadcrumb(Mage::helper("adminhtml")->__("Storelocator Manager"),Mage::helper("adminhtml")->__("Storelocator Manager"));
|
8 |
+
return $this;
|
9 |
+
}
|
10 |
+
public function indexAction()
|
11 |
+
{
|
12 |
+
$this->_title($this->__("Storelocator"));
|
13 |
+
$this->_title($this->__("Manager Storelocator"));
|
14 |
+
|
15 |
+
$this->_initAction();
|
16 |
+
$this->renderLayout();
|
17 |
+
}
|
18 |
+
public function editAction()
|
19 |
+
{
|
20 |
+
$this->_title($this->__("Storelocator"));
|
21 |
+
$this->_title($this->__("Storelocator"));
|
22 |
+
$this->_title($this->__("Edit Item"));
|
23 |
+
|
24 |
+
$id = $this->getRequest()->getParam("id");
|
25 |
+
$model = Mage::getModel("storelocator/storelocator")->load($id);
|
26 |
+
if ($model->getId()) {
|
27 |
+
Mage::register("storelocator_data", $model);
|
28 |
+
$this->loadLayout();
|
29 |
+
$this->_setActiveMenu("storelocator/storelocator");
|
30 |
+
$this->_addBreadcrumb(Mage::helper("adminhtml")->__("Storelocator Manager"), Mage::helper("adminhtml")->__("Storelocator Manager"));
|
31 |
+
$this->_addBreadcrumb(Mage::helper("adminhtml")->__("Storelocator Description"), Mage::helper("adminhtml")->__("Storelocator Description"));
|
32 |
+
$this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
|
33 |
+
$this->_addContent($this->getLayout()->createBlock("storelocator/adminhtml_storelocator_edit"))->_addLeft($this->getLayout()->createBlock("storelocator/adminhtml_storelocator_edit_tabs"));
|
34 |
+
$this->renderLayout();
|
35 |
+
}
|
36 |
+
else {
|
37 |
+
Mage::getSingleton("adminhtml/session")->addError(Mage::helper("storelocator")->__("Item does not exist."));
|
38 |
+
$this->_redirect("*/*/");
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
public function newAction()
|
43 |
+
{
|
44 |
+
|
45 |
+
$this->_title($this->__("Storelocator"));
|
46 |
+
$this->_title($this->__("Storelocator"));
|
47 |
+
$this->_title($this->__("New Item"));
|
48 |
+
|
49 |
+
$id = $this->getRequest()->getParam("id");
|
50 |
+
$model = Mage::getModel("storelocator/storelocator")->load($id);
|
51 |
+
|
52 |
+
$data = Mage::getSingleton("adminhtml/session")->getFormData(true);
|
53 |
+
if (!empty($data)) {
|
54 |
+
$model->setData($data);
|
55 |
+
}
|
56 |
+
|
57 |
+
Mage::register("storelocator_data", $model);
|
58 |
+
|
59 |
+
$this->loadLayout();
|
60 |
+
$this->_setActiveMenu("storelocator/storelocator");
|
61 |
+
|
62 |
+
$this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
|
63 |
+
|
64 |
+
$this->_addBreadcrumb(Mage::helper("adminhtml")->__("Storelocator Manager"), Mage::helper("adminhtml")->__("Storelocator Manager"));
|
65 |
+
$this->_addBreadcrumb(Mage::helper("adminhtml")->__("Storelocator Description"), Mage::helper("adminhtml")->__("Storelocator Description"));
|
66 |
+
|
67 |
+
|
68 |
+
$this->_addContent($this->getLayout()->createBlock("storelocator/adminhtml_storelocator_edit"))->_addLeft($this->getLayout()->createBlock("storelocator/adminhtml_storelocator_edit_tabs"));
|
69 |
+
|
70 |
+
$this->renderLayout();
|
71 |
+
|
72 |
+
}
|
73 |
+
public function saveAction()
|
74 |
+
{
|
75 |
+
|
76 |
+
$post_data=$this->getRequest()->getPost();
|
77 |
+
|
78 |
+
|
79 |
+
if ($post_data) {
|
80 |
+
|
81 |
+
try {
|
82 |
+
|
83 |
+
|
84 |
+
//save image
|
85 |
+
try{
|
86 |
+
|
87 |
+
if((bool)$post_data['image']['delete']==1) {
|
88 |
+
|
89 |
+
$post_data['image']='';
|
90 |
+
|
91 |
+
}
|
92 |
+
else {
|
93 |
+
|
94 |
+
unset($post_data['image']);
|
95 |
+
|
96 |
+
if (isset($_FILES)){
|
97 |
+
|
98 |
+
if ($_FILES['image']['name']) {
|
99 |
+
|
100 |
+
if($this->getRequest()->getParam("id")){
|
101 |
+
$model = Mage::getModel("storelocator/storelocator")->load($this->getRequest()->getParam("id"));
|
102 |
+
if($model->getData('image')){
|
103 |
+
$io = new Varien_Io_File();
|
104 |
+
$io->rm(Mage::getBaseDir('media').DS.implode(DS,explode('/',$model->getData('image'))));
|
105 |
+
}
|
106 |
+
}
|
107 |
+
$path = Mage::getBaseDir('media') . DS . 'storelocator' . DS .'storelocator'.DS;
|
108 |
+
$uploader = new Varien_File_Uploader('image');
|
109 |
+
$uploader->setAllowedExtensions(array('jpg','png','gif'));
|
110 |
+
$uploader->setAllowRenameFiles(false);
|
111 |
+
$uploader->setFilesDispersion(false);
|
112 |
+
$destFile = $path.$_FILES['image']['name'];
|
113 |
+
$filename = $uploader->getNewFileName($destFile);
|
114 |
+
$uploader->save($path, $filename);
|
115 |
+
|
116 |
+
$post_data['image']='storelocator/storelocator/'.$filename;
|
117 |
+
}
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
} catch (Exception $e) {
|
122 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
123 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
124 |
+
return;
|
125 |
+
}
|
126 |
+
//save image
|
127 |
+
|
128 |
+
//save image
|
129 |
+
try{
|
130 |
+
|
131 |
+
if((bool)$post_data['marker']['delete']==1) {
|
132 |
+
|
133 |
+
$post_data['marker']='';
|
134 |
+
|
135 |
+
}
|
136 |
+
else {
|
137 |
+
|
138 |
+
unset($post_data['marker']);
|
139 |
+
|
140 |
+
if (isset($_FILES)){
|
141 |
+
|
142 |
+
if ($_FILES['marker']['name']) {
|
143 |
+
|
144 |
+
if($this->getRequest()->getParam("id")){
|
145 |
+
$model = Mage::getModel("storelocator/storelocator")->load($this->getRequest()->getParam("id"));
|
146 |
+
if($model->getData('marker')){
|
147 |
+
$io = new Varien_Io_File();
|
148 |
+
$io->rm(Mage::getBaseDir('media').DS.implode(DS,explode('/',$model->getData('marker'))));
|
149 |
+
}
|
150 |
+
}
|
151 |
+
$path = Mage::getBaseDir('media') . DS . 'storelocator' . DS .'storelocator'.DS;
|
152 |
+
$uploader = new Varien_File_Uploader('marker');
|
153 |
+
$uploader->setAllowedExtensions(array('jpg','png','gif'));
|
154 |
+
$uploader->setAllowRenameFiles(false);
|
155 |
+
$uploader->setFilesDispersion(false);
|
156 |
+
$destFile = $path.$_FILES['marker']['name'];
|
157 |
+
$filename = $uploader->getNewFileName($destFile);
|
158 |
+
$uploader->save($path, $filename);
|
159 |
+
|
160 |
+
$post_data['marker']='storelocator/storelocator/'.$filename;
|
161 |
+
}
|
162 |
+
}
|
163 |
+
}
|
164 |
+
|
165 |
+
} catch (Exception $e) {
|
166 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
167 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
168 |
+
return;
|
169 |
+
}
|
170 |
+
//save image
|
171 |
+
|
172 |
+
|
173 |
+
$model = Mage::getModel("storelocator/storelocator")
|
174 |
+
->addData($post_data)
|
175 |
+
->setId($this->getRequest()->getParam("id"))
|
176 |
+
->save();
|
177 |
+
|
178 |
+
Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Storelocator was successfully saved"));
|
179 |
+
Mage::getSingleton("adminhtml/session")->setStorelocatorData(false);
|
180 |
+
|
181 |
+
if ($this->getRequest()->getParam("back")) {
|
182 |
+
$this->_redirect("*/*/edit", array("id" => $model->getId()));
|
183 |
+
return;
|
184 |
+
}
|
185 |
+
$this->_redirect("*/*/");
|
186 |
+
return;
|
187 |
+
}
|
188 |
+
catch (Exception $e) {
|
189 |
+
Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
|
190 |
+
Mage::getSingleton("adminhtml/session")->setStorelocatorData($this->getRequest()->getPost());
|
191 |
+
$this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
|
192 |
+
return;
|
193 |
+
}
|
194 |
+
|
195 |
+
}
|
196 |
+
$this->_redirect("*/*/");
|
197 |
+
}
|
198 |
+
|
199 |
+
|
200 |
+
|
201 |
+
public function deleteAction()
|
202 |
+
{
|
203 |
+
if( $this->getRequest()->getParam("id") > 0 ) {
|
204 |
+
try {
|
205 |
+
$model = Mage::getModel("storelocator/storelocator");
|
206 |
+
$model->setId($this->getRequest()->getParam("id"))->delete();
|
207 |
+
Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Item was successfully deleted"));
|
208 |
+
$this->_redirect("*/*/");
|
209 |
+
}
|
210 |
+
catch (Exception $e) {
|
211 |
+
Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
|
212 |
+
$this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
|
213 |
+
}
|
214 |
+
}
|
215 |
+
$this->_redirect("*/*/");
|
216 |
+
}
|
217 |
+
|
218 |
+
|
219 |
+
public function massRemoveAction()
|
220 |
+
{
|
221 |
+
try {
|
222 |
+
$ids = $this->getRequest()->getPost('ids', array());
|
223 |
+
foreach ($ids as $id) {
|
224 |
+
$model = Mage::getModel("storelocator/storelocator");
|
225 |
+
$model->setId($id)->delete();
|
226 |
+
}
|
227 |
+
Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Item(s) was successfully removed"));
|
228 |
+
}
|
229 |
+
catch (Exception $e) {
|
230 |
+
Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
|
231 |
+
}
|
232 |
+
$this->_redirect('*/*/');
|
233 |
+
}
|
234 |
+
|
235 |
+
/**
|
236 |
+
* Export order grid to CSV format
|
237 |
+
*/
|
238 |
+
public function exportCsvAction()
|
239 |
+
{
|
240 |
+
$fileName = 'storelocator.csv';
|
241 |
+
$grid = $this->getLayout()->createBlock('storelocator/adminhtml_storelocator_grid');
|
242 |
+
$this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
|
243 |
+
}
|
244 |
+
/**
|
245 |
+
* Export order grid to Excel XML format
|
246 |
+
*/
|
247 |
+
public function exportExcelAction()
|
248 |
+
{
|
249 |
+
$fileName = 'storelocator.xml';
|
250 |
+
$grid = $this->getLayout()->createBlock('storelocator/adminhtml_storelocator_grid');
|
251 |
+
$this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));
|
252 |
+
}
|
253 |
+
}
|
app/code/community/Mks/Storelocator/controllers/Adminhtml/StorelocatorbackendController.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Mks_Storelocator_Adminhtml_StorelocatorbackendController extends Mage_Adminhtml_Controller_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
$this->loadLayout();
|
7 |
+
$this->_title($this->__("About us"));
|
8 |
+
$this->renderLayout();
|
9 |
+
}
|
10 |
+
}
|
app/code/community/Mks/Storelocator/controllers/IndexController.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Mks_Storelocator_IndexController extends Mage_Core_Controller_Front_Action{
|
3 |
+
public function IndexAction() {
|
4 |
+
|
5 |
+
$this->loadLayout();
|
6 |
+
$this->getLayout()->getBlock("head")->setTitle($this->__("Storelocator"));
|
7 |
+
$breadcrumbs = $this->getLayout()->getBlock("breadcrumbs");
|
8 |
+
$breadcrumbs->addCrumb("home", array(
|
9 |
+
"label" => $this->__("Home Page"),
|
10 |
+
"title" => $this->__("Home Page"),
|
11 |
+
"link" => Mage::getBaseUrl()
|
12 |
+
));
|
13 |
+
|
14 |
+
$breadcrumbs->addCrumb("storelocator", array(
|
15 |
+
"label" => $this->__("Storelocator"),
|
16 |
+
"title" => $this->__("Storelocator")
|
17 |
+
));
|
18 |
+
|
19 |
+
$this->renderLayout();
|
20 |
+
|
21 |
+
}
|
22 |
+
}
|
app/code/community/Mks/Storelocator/etc/config.xml
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Mks_Storelocator>
|
5 |
+
<version>1.1.1</version>
|
6 |
+
</Mks_Storelocator>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<storelocator>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>Mks_Storelocator</module>
|
14 |
+
<frontName>storelocator</frontName>
|
15 |
+
</args>
|
16 |
+
</storelocator>
|
17 |
+
</routers>
|
18 |
+
<layout>
|
19 |
+
<updates>
|
20 |
+
<storelocator>
|
21 |
+
<file>storelocator.xml</file>
|
22 |
+
</storelocator>
|
23 |
+
</updates>
|
24 |
+
</layout>
|
25 |
+
</frontend>
|
26 |
+
<global>
|
27 |
+
<helpers>
|
28 |
+
<storelocator>
|
29 |
+
<class>Mks_Storelocator_Helper</class>
|
30 |
+
</storelocator>
|
31 |
+
</helpers>
|
32 |
+
<blocks>
|
33 |
+
<storelocator>
|
34 |
+
<class>Mks_Storelocator_Block</class>
|
35 |
+
</storelocator>
|
36 |
+
</blocks>
|
37 |
+
<models>
|
38 |
+
<storelocator>
|
39 |
+
<class>Mks_Storelocator_Model</class>
|
40 |
+
<resourceModel>storelocator_mysql4</resourceModel>
|
41 |
+
</storelocator>
|
42 |
+
<storelocator_mysql4>
|
43 |
+
<class>Mks_Storelocator_Model_Mysql4</class>
|
44 |
+
<entities>
|
45 |
+
<storelocator>
|
46 |
+
<table>mksstorelocator</table>
|
47 |
+
</storelocator>
|
48 |
+
</entities>
|
49 |
+
</storelocator_mysql4>
|
50 |
+
</models>
|
51 |
+
<resources>
|
52 |
+
<storelocator_setup>
|
53 |
+
<setup>
|
54 |
+
<module>Mks_Storelocator</module>
|
55 |
+
</setup>
|
56 |
+
<connection>
|
57 |
+
<use>core_setup</use>
|
58 |
+
</connection>
|
59 |
+
</storelocator_setup>
|
60 |
+
<storelocator_write>
|
61 |
+
<connection>
|
62 |
+
<use>core_write</use>
|
63 |
+
</connection>
|
64 |
+
</storelocator_write>
|
65 |
+
<storelocator_read>
|
66 |
+
<connection>
|
67 |
+
<use>core_read</use>
|
68 |
+
</connection>
|
69 |
+
</storelocator_read>
|
70 |
+
</resources>
|
71 |
+
</global>
|
72 |
+
<admin>
|
73 |
+
<routers>
|
74 |
+
<storelocator>
|
75 |
+
<use>admin</use>
|
76 |
+
<args>
|
77 |
+
<module>Mks_Storelocator</module>
|
78 |
+
<frontName>storelocator</frontName>
|
79 |
+
</args>
|
80 |
+
</storelocator>
|
81 |
+
</routers>
|
82 |
+
</admin>
|
83 |
+
<adminhtml>
|
84 |
+
<menu>
|
85 |
+
<storelocator module="storelocator">
|
86 |
+
<title>Storelocator</title>
|
87 |
+
<sort_order>100</sort_order>
|
88 |
+
<children>
|
89 |
+
<storelocatorbackend module="storelocator">
|
90 |
+
<title>About us</title>
|
91 |
+
<sort_order>0</sort_order>
|
92 |
+
<action>storelocator/adminhtml_storelocatorbackend</action>
|
93 |
+
</storelocatorbackend>
|
94 |
+
<storelocator module="storelocator">
|
95 |
+
<title>Manage Storelocator</title>
|
96 |
+
<sort_order>0</sort_order>
|
97 |
+
<action>storelocator/adminhtml_storelocator</action>
|
98 |
+
</storelocator>
|
99 |
+
</children>
|
100 |
+
</storelocator>
|
101 |
+
</menu>
|
102 |
+
<acl>
|
103 |
+
<resources>
|
104 |
+
<all>
|
105 |
+
<title>Allow Everything</title>
|
106 |
+
</all>
|
107 |
+
<admin>
|
108 |
+
<children>
|
109 |
+
<storelocator translate="title" module="storelocator">
|
110 |
+
<title>Storelocator</title>
|
111 |
+
<sort_order>1000</sort_order>
|
112 |
+
<children>
|
113 |
+
<storelocatorbackend translate="title">
|
114 |
+
<title>About us</title>
|
115 |
+
</storelocatorbackend>
|
116 |
+
<storelocator translate="title">
|
117 |
+
<title>Manage Storelocator</title>
|
118 |
+
<sort_order>0</sort_order>
|
119 |
+
</storelocator>
|
120 |
+
</children>
|
121 |
+
</storelocator>
|
122 |
+
</children>
|
123 |
+
</admin>
|
124 |
+
</resources>
|
125 |
+
</acl>
|
126 |
+
<layout>
|
127 |
+
<updates>
|
128 |
+
<storelocator>
|
129 |
+
<file>storelocator.xml</file>
|
130 |
+
</storelocator>
|
131 |
+
</updates>
|
132 |
+
</layout>
|
133 |
+
</adminhtml>
|
134 |
+
</config>
|
app/code/community/Mks/Storelocator/sql/storelocator_setup/mysql4-install-1.1.1.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
$sql=<<<SQLTEXT
|
5 |
+
create table mksstorelocator(id int not null auto_increment, name varchar(100), address varchar(255),zipcode varchar(100),city varchar(100),country_id varchar(100),phone varchar(100),fax varchar(100),description varchar(255),store_url varchar(100),image varchar(100),marker varchar(100),lat varchar(100),longt varchar(100),status varchar(100),primary key(id));
|
6 |
+
|
7 |
+
SQLTEXT;
|
8 |
+
|
9 |
+
$installer->run($sql);
|
10 |
+
//demo
|
11 |
+
Mage::getModel('core/url_rewrite')->setId(null);
|
12 |
+
//demo
|
13 |
+
$installer->endSetup();
|
14 |
+
|
app/design/adminhtml/default/default/layout/storelocator.xml
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<storelocator_adminhtml_storelocatorbackend_index>
|
4 |
+
<reference name="content">
|
5 |
+
<block type="storelocator/adminhtml_storelocatorbackend" name="storelocatorbackend" template="storelocator/storelocatorbackend.phtml"/>
|
6 |
+
</reference>
|
7 |
+
</storelocator_adminhtml_storelocatorbackend_index>
|
8 |
+
<storelocator_adminhtml_storelocator_index>
|
9 |
+
<reference name="content">
|
10 |
+
<block type="storelocator/adminhtml_storelocator" name="storelocator" />
|
11 |
+
</reference>
|
12 |
+
</storelocator_adminhtml_storelocator_index>
|
13 |
+
</layout>
|
app/design/adminhtml/default/default/template/storelocator/storelocatorbackend.phtml
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<h1>Storelocator</h1>
|
2 |
+
<b>Display your locations on the map and make customers know where your offline shops are situated. </b>
|
3 |
+
|
4 |
+
<b>Here you can add your all store address and description with google map and many more. </b>
|
5 |
+
|
6 |
+
<h2>Store Locator </h2>
|
7 |
+
<p>
|
8 |
+
The Store Locator Magento extension is an amazing tool for merchants who have physical locations of retailers. The module gives you a help in adding store addresses to the website and navigating visitors to the required one.
|
9 |
+
</p>
|
10 |
+
|
11 |
+
<p>
|
12 |
+
You can create as many locations as you need - they will be displayed in a pleasant vertical presentation on a separate page. Just specify the address of your store and see how it will be automatically detected on the map. Let your customers easily find the page with addresses by adding store locations url to the top Magento links. Customers get to know all existed locations on the map and view the detailed information about them by clicking the store icon.
|
13 |
+
</p>
|
app/design/frontend/base/default/layout/storelocator.xml
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="1.1.1">
|
3 |
+
<storelocator_index_index>
|
4 |
+
<reference name="root">
|
5 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
6 |
+
</reference>
|
7 |
+
<reference name="content">
|
8 |
+
<block type="storelocator/index" name="storelocator_index" template="storelocator/index.phtml"/>
|
9 |
+
</reference>
|
10 |
+
</storelocator_index_index>
|
11 |
+
</layout>
|
12 |
+
|
app/design/frontend/base/default/template/storelocator/index.phtml
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$connection = Mage::getSingleton('core/resource')->getConnection('core_write');
|
3 |
+
$sql1 = $connection->query("select * from mksstorelocator order by id limit 1" );
|
4 |
+
$row1 = $sql1->fetch();
|
5 |
+
$latitudex = $row1['lat'];
|
6 |
+
$longitudex = $row1['longt'];
|
7 |
+
$addressx = $row1['address'];
|
8 |
+
?>
|
9 |
+
|
10 |
+
<script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
|
11 |
+
<script src="https://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
|
12 |
+
<script type="text/javascript">
|
13 |
+
|
14 |
+
function map_xxx(x,y,z)
|
15 |
+
{
|
16 |
+
var latitude = x; // parseFloat("26.850883100000000000");
|
17 |
+
var longitude = y; // parseFloat("75.824783600000040000");
|
18 |
+
var address = z; // "Rohini, New Delhi, Delhi, India";
|
19 |
+
var latlngPos = new google.maps.LatLng(latitude,longitude);
|
20 |
+
|
21 |
+
// Set up options for the Google map
|
22 |
+
var myOptions = {
|
23 |
+
zoom: 10,
|
24 |
+
center: latlngPos,
|
25 |
+
mapTypeId: google.maps.MapTypeId.ROADMAP,
|
26 |
+
zoomControlOptions: true,
|
27 |
+
zoomControlOptions: {
|
28 |
+
style: google.maps.ZoomControlStyle.LARGE
|
29 |
+
}
|
30 |
+
};
|
31 |
+
// Define the map
|
32 |
+
map = new google.maps.Map(document.getElementById("map"), myOptions);
|
33 |
+
// Add the marker
|
34 |
+
var marker = new google.maps.Marker({
|
35 |
+
position: latlngPos,
|
36 |
+
map: map,
|
37 |
+
draggable: false,
|
38 |
+
title: address
|
39 |
+
});
|
40 |
+
|
41 |
+
};
|
42 |
+
</script>
|
43 |
+
|
44 |
+
<body onload="map_xxx('<?php echo $latitudex ?>','<?php echo $longitudex; ?>','<?php echo $addressx; ?>');">
|
45 |
+
|
46 |
+
<table id="map_xxx" style="width:900px; border:10px;">
|
47 |
+
<tr><td style="width:400px;">
|
48 |
+
<?php
|
49 |
+
$sql = $connection->query("select * from mksstorelocator" );
|
50 |
+
while($row = $sql->fetch())
|
51 |
+
{?>
|
52 |
+
<table id="store-table" class="store-table">
|
53 |
+
<tr>
|
54 |
+
<td rowspan="8" class="store-image">
|
55 |
+
<img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).$row['image']; ?>" alt="Manvendra sharma" width="50">
|
56 |
+
</td>
|
57 |
+
</tr>
|
58 |
+
<tr>
|
59 |
+
<td>
|
60 |
+
<h3 class="store_name" onclick="map_xxx('<?php echo $row['lat']; ?>','<?php echo $row['longt']; ?>','<?php echo $row['address']; ?>');"><?php echo $row['name']; ?></h3>
|
61 |
+
</td>
|
62 |
+
</tr>
|
63 |
+
<tr>
|
64 |
+
<td class="col-address"><?php echo $row['city']; ?></td>
|
65 |
+
</tr>
|
66 |
+
<tr>
|
67 |
+
<?php
|
68 |
+
$add = $row['zipcode'].$row['address'];
|
69 |
+
?>
|
70 |
+
<td class="col-address"><?php echo $add; ?></td>
|
71 |
+
</tr>
|
72 |
+
<tr>
|
73 |
+
<td class="col-address"><?php echo $row['country_id']; ?> </td>
|
74 |
+
</tr>
|
75 |
+
<tr>
|
76 |
+
<td>Website : <a href="<?php echo $row['store_url']; ?>" target="_blank"><?php echo $row['store_url']; ?></a></td>
|
77 |
+
</tr>
|
78 |
+
<tr>
|
79 |
+
<td> Phone :<?php echo $row['phone']; ?> </td>
|
80 |
+
</tr>
|
81 |
+
<tr>
|
82 |
+
<td> Fax :<?php echo $row['fax']; ?></td>
|
83 |
+
</tr>
|
84 |
+
</table>
|
85 |
+
<?php } ?>
|
86 |
+
|
87 |
+
</td>
|
88 |
+
|
89 |
+
<td style="width:500px;">
|
90 |
+
<div id="map" style="width:500px; height:500px;"></div>
|
91 |
+
</td></tr></table>
|
app/etc/modules/Mks_Storelocator.xml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Mks_Storelocator>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
<version>1.1.1</version>
|
8 |
+
</Mks_Storelocator>
|
9 |
+
</modules>
|
10 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Mks_Storelocator</name>
|
4 |
+
<version>1.1.1</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>OSL</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Help your customers to find a physical store. Navigation system and a lot of others features to discover ! </summary>
|
10 |
+
<description>Magento Store locator extension provides you the best solution to easily set up and reference all your physical stores using the google Map API.
|
11 |
+
Magento Store locator is easy to install and set up.</description>
|
12 |
+
<notes>Magento Store locator extension provides you the best solution to easily set up and reference all your physical stores using the google Map API.
|
13 |
+
Magento Store locator is easy to install and set up.</notes>
|
14 |
+
<authors><author><name>Mukesh Kumar saini</name><user>mukeshbagri</user><email>in.mukeshsaini@gmail.com</email></author></authors>
|
15 |
+
<date>2014-01-02</date>
|
16 |
+
<time>07:11:46</time>
|
17 |
+
<contents><target name="magecommunity"><dir name="Mks"><dir name="Storelocator"><dir name="Block"><dir name="Adminhtml"><dir name="Storelocator"><dir name="Edit"><file name="Form.php" hash="00fed13f02e804d93bac7258689769ad"/><dir name="Tab"><file name="Form.php" hash="4620d9bad225fc9dc88b808fccae3b2f"/></dir><file name="Tabs.php" hash="8819f35cd4af4b61d14bf377c58432b6"/></dir><file name="Edit.php" hash="9be35d036a69cfb545d2f1c1649cb6ba"/><file name="Grid.php" hash="c1901ceac4aec85340a9d4f2d5e9df9f"/></dir><file name="Storelocator.php" hash="81770ec5e092a177c22e188b8db38d7e"/><file name="Storelocatorbackend.php" hash="d600cb8ff797f008c7c652a299305c8d"/></dir><file name="Index.php" hash="85128403f14502fe6642a23231079532"/></dir><dir name="Helper"><file name="Data.php" hash="083521dd42bf734a864e06dceb37b5a0"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Storelocator"><file name="Collection.php" hash="183c5eeeb2ef6b444bfc08a829b93cde"/></dir><file name="Storelocator.php" hash="29d65325bd746be070275726e309afdb"/></dir><file name="Storelocator.php" hash="e91d32a733f49d62d54c1335a57e2ee5"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="StorelocatorController.php" hash="0c853bc509d0069930481f4d09e426c6"/><file name="StorelocatorbackendController.php" hash="ea616e919ef3a6492ebbfb55daf57ea1"/></dir><file name="IndexController.php" hash="2da311b739d05591f0f4355c740cb5bc"/></dir><dir name="etc"><file name="config.xml" hash="1aed48b7351a7e3dcd8924c146ac4af0"/></dir><dir name="sql"><dir name="storelocator_setup"><file name="mysql4-install-1.1.1.php" hash="c30c6bcbb6b8b6a211f66e3e0da62586"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mks_Storelocator.xml" hash="a6f6119398e1ac1d5d007d16f0b1a9c9"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="storelocator.xml" hash="c5ce52ab3f3f3d71dbb902134642e2dc"/></dir><dir name="template"><dir name="storelocator"><file name="storelocatorbackend.phtml" hash="e07dd382a8826b59d7ff43774fc73d87"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="storelocator.xml" hash="db01f1e299e94c6a4d633a1d2458f343"/></dir><dir name="template"><dir name="storelocator"><file name="index.phtml" hash="8e1c82a98529be3dd1d8fc5eb15b7580"/></dir></dir></dir></dir></dir></target></contents>
|
18 |
+
<compatible/>
|
19 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
20 |
+
</package>
|