Version Notes
(1)Added Import/Export stores functionality
(2)Added Unique index for store name
(3)Updated design of store list and store detail page
Download this release
Release Info
Developer | Clarion Tech |
Extension | Clarion_Storelocator |
Version | 1.0.2 |
Comparing to | |
See all releases |
Code changes from version 1.0.1 to 1.0.2
- app/code/community/Clarion/Storelocator/Block/Adminhtml/Import/Edit.php +48 -0
- app/code/community/Clarion/Storelocator/Block/Adminhtml/Import/Edit/Form.php +47 -0
- app/code/community/Clarion/Storelocator/Block/Adminhtml/Storelocator/Grid.php +109 -11
- app/code/community/Clarion/Storelocator/Block/Adminhtml/Storelocator/Renderer/Store.php +41 -0
- app/code/community/Clarion/Storelocator/Helper/Data.php +10 -0
- app/code/community/Clarion/Storelocator/Helper/Validation.php +82 -0
- app/code/community/Clarion/Storelocator/Model/Resource/Storelocator.php +326 -2
- app/code/community/Clarion/Storelocator/Model/Storelocator.php +15 -0
- app/code/community/Clarion/Storelocator/controllers/Adminhtml/ImportstorelocatorController.php +98 -0
- app/code/community/Clarion/Storelocator/controllers/Adminhtml/ManagestorelocatorController.php +5 -0
- app/code/community/Clarion/Storelocator/data/clarion_storelocator_setup/data-install-0.1.1.php +1 -1
- app/code/community/Clarion/Storelocator/data/clarion_storelocator_setup/data-upgrade-0.1.0-0.1.1.php +1 -1
- app/code/community/Clarion/Storelocator/etc/adminhtml.xml +30 -0
- app/code/community/Clarion/Storelocator/etc/config.xml +1 -1
- app/code/community/Clarion/Storelocator/sql/clarion_storelocator_setup/install-0.1.1.php +1 -1
- app/code/community/Clarion/Storelocator/sql/clarion_storelocator_setup/install-0.1.2.php +177 -0
- app/code/community/Clarion/Storelocator/sql/clarion_storelocator_setup/upgrade-0.1.0-0.1.1.php +1 -1
- app/code/community/Clarion/Storelocator/sql/clarion_storelocator_setup/upgrade-0.1.1-0.1.2.php +26 -0
- app/design/adminhtml/default/default/layout/clarion_storelocator.xml +5 -0
- app/design/frontend/base/default/layout/clarion_storelocator.xml +2 -2
- app/design/frontend/base/default/template/clarion/storelocator/view.phtml +2 -2
- media/clarion_storelocator/cache/400/demo2.png +0 -0
- media/clarion_storelocator/cache/400/demo4.png +0 -0
- media/clarion_storelocator/cache/400/demo5.png +0 -0
- media/clarion_storelocator/cache/400/red3.jpeg +0 -0
- media/clarion_storelocator/demo1.png +0 -0
- media/clarion_storelocator/demo5.png +0 -0
- package.xml +8 -6
- skin/frontend/base/default/css/clarion_storelocator.css +13 -6
app/code/community/Clarion/Storelocator/Block/Adminhtml/Import/Edit.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Import edit block
|
4 |
+
*
|
5 |
+
* @category Clarion
|
6 |
+
* @package Clarion_Storelocator
|
7 |
+
* @author Clarion Magento Team <magento@clariontechnologies.co.in>
|
8 |
+
*/
|
9 |
+
class Clarion_Storelocator_Block_Adminhtml_Import_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
10 |
+
{
|
11 |
+
/**
|
12 |
+
* Constructor
|
13 |
+
*
|
14 |
+
* @return void
|
15 |
+
*/
|
16 |
+
public function __construct()
|
17 |
+
{
|
18 |
+
parent::__construct();
|
19 |
+
|
20 |
+
$this->removeButton('back')
|
21 |
+
->removeButton('reset')
|
22 |
+
->_updateButton('save', 'label', $this->__('Import'))
|
23 |
+
->_updateButton('save', 'id', 'upload_button');
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Internal constructor
|
28 |
+
*
|
29 |
+
* @return void
|
30 |
+
*/
|
31 |
+
protected function _construct()
|
32 |
+
{
|
33 |
+
parent::_construct();
|
34 |
+
|
35 |
+
$this->_blockGroup = 'clarion_storelocator';
|
36 |
+
$this->_controller = 'adminhtml_import';
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Get header text
|
41 |
+
*
|
42 |
+
* @return string
|
43 |
+
*/
|
44 |
+
public function getHeaderText()
|
45 |
+
{
|
46 |
+
return Mage::helper('clarion_storelocator')->__('Import');
|
47 |
+
}
|
48 |
+
}
|
app/code/community/Clarion/Storelocator/Block/Adminhtml/Import/Edit/Form.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Import edit form block
|
4 |
+
*
|
5 |
+
* @category Clarion
|
6 |
+
* @package Clarion_Storelocator
|
7 |
+
* @author Clarion Magento Team <magento@clariontechnologies.co.in>
|
8 |
+
*/
|
9 |
+
class Clarion_Storelocator_Block_Adminhtml_Import_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
10 |
+
{
|
11 |
+
/**
|
12 |
+
* Add fieldset
|
13 |
+
*
|
14 |
+
* @return Clarion_Storelocator_Block_Adminhtml_Import_Edit_Form
|
15 |
+
*/
|
16 |
+
protected function _prepareForm()
|
17 |
+
{
|
18 |
+
$form = new Varien_Data_Form(array(
|
19 |
+
'id' => 'edit_form',
|
20 |
+
'action' => $this->getUrl('*/*/save'),
|
21 |
+
'method' => 'post',
|
22 |
+
'enctype' => 'multipart/form-data'
|
23 |
+
));
|
24 |
+
$fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('clarion_storelocator')->__('Import Settings')));
|
25 |
+
|
26 |
+
$fieldset->addField('behavior', 'select', array(
|
27 |
+
'name' => 'behavior',
|
28 |
+
'title' => Mage::helper('clarion_storelocator')->__('Overwrite existing store(s)'),
|
29 |
+
'label' => Mage::helper('clarion_storelocator')->__('Overwrite existing store(s)'),
|
30 |
+
'required' => true,
|
31 |
+
'values' => Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray(),
|
32 |
+
'value' => 1,
|
33 |
+
));
|
34 |
+
|
35 |
+
$fieldset->addField('import_file', 'file', array(
|
36 |
+
'name' => 'import_file',
|
37 |
+
'label' => Mage::helper('clarion_storelocator')->__('Select File to Import'),
|
38 |
+
'title' => Mage::helper('clarion_storelocator')->__('Select File to Import'),
|
39 |
+
'required' => true
|
40 |
+
));
|
41 |
+
|
42 |
+
$form->setUseContainer(true);
|
43 |
+
$this->setForm($form);
|
44 |
+
|
45 |
+
return parent::_prepareForm();
|
46 |
+
}
|
47 |
+
}
|
app/code/community/Clarion/Storelocator/Block/Adminhtml/Storelocator/Grid.php
CHANGED
@@ -100,18 +100,29 @@ class Clarion_Storelocator_Block_Adminhtml_Storelocator_Grid extends Mage_Adminh
|
|
100 |
));
|
101 |
|
102 |
/**
|
103 |
-
*
|
104 |
*/
|
105 |
-
if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
$this->addColumn('store_id', array(
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
'store_all' => true,
|
111 |
-
'store_view' => true,
|
112 |
-
'sortable' => false,
|
113 |
-
'filter_condition_callback'
|
114 |
-
=> array($this, '_filterStoreCondition'),
|
115 |
));
|
116 |
}
|
117 |
|
@@ -143,7 +154,94 @@ class Clarion_Storelocator_Block_Adminhtml_Storelocator_Grid extends Mage_Adminh
|
|
143 |
'index' => 'stores',
|
144 |
'is_system' => true,
|
145 |
));
|
146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
//Import Export functionality
|
148 |
$this->addExportType('*/*/exportCsv', Mage::helper('clarion_storelocator')->__('CSV'));
|
149 |
$this->addExportType('*/*/exportXml', Mage::helper('clarion_storelocator')->__('XML'));
|
100 |
));
|
101 |
|
102 |
/**
|
103 |
+
* _isExport flag used to show columns only in csv export not in the grid
|
104 |
*/
|
105 |
+
if(!$this->_isExport) {
|
106 |
+
/**
|
107 |
+
* Check is single store mode
|
108 |
+
*/
|
109 |
+
if (!Mage::app()->isSingleStoreMode()) {
|
110 |
+
$this->addColumn('store_id', array(
|
111 |
+
'header' => Mage::helper('clarion_storelocator')->__('Store View'),
|
112 |
+
'index' => 'store_id',
|
113 |
+
'type' => 'store',
|
114 |
+
'store_all' => true,
|
115 |
+
'store_view' => true,
|
116 |
+
'sortable' => false,
|
117 |
+
'filter_condition_callback'
|
118 |
+
=> array($this, '_filterStoreCondition'),
|
119 |
+
));
|
120 |
+
}
|
121 |
+
} else {
|
122 |
$this->addColumn('store_id', array(
|
123 |
+
'header'=> Mage::helper('clarion_storelocator')->__('Store View [ admin - All Store Views ]'),
|
124 |
+
'index' => 'store_id',
|
125 |
+
'renderer' => 'Clarion_Storelocator_Block_Adminhtml_Storelocator_Renderer_Store',
|
|
|
|
|
|
|
|
|
|
|
126 |
));
|
127 |
}
|
128 |
|
154 |
'index' => 'stores',
|
155 |
'is_system' => true,
|
156 |
));
|
157 |
+
|
158 |
+
/**
|
159 |
+
* columns for export csv
|
160 |
+
*/
|
161 |
+
if($this->_isExport) {
|
162 |
+
$this->addColumn('street_address', array(
|
163 |
+
'header'=>Mage::helper('clarion_storelocator')->__('Street Address'),
|
164 |
+
'index'=>'street_address'
|
165 |
+
));
|
166 |
+
}
|
167 |
+
|
168 |
+
if($this->_isExport) {
|
169 |
+
$this->addColumn('phone', array(
|
170 |
+
'header'=>Mage::helper('clarion_storelocator')->__('Phone'),
|
171 |
+
'index'=>'phone'
|
172 |
+
));
|
173 |
+
}
|
174 |
+
|
175 |
+
if($this->_isExport) {
|
176 |
+
$this->addColumn('fax', array(
|
177 |
+
'header'=>Mage::helper('clarion_storelocator')->__('Fax'),
|
178 |
+
'index'=>'fax'
|
179 |
+
));
|
180 |
+
}
|
181 |
+
|
182 |
+
if($this->_isExport) {
|
183 |
+
$this->addColumn('url', array(
|
184 |
+
'header'=>Mage::helper('clarion_storelocator')->__('URL'),
|
185 |
+
'index'=>'url'
|
186 |
+
));
|
187 |
+
}
|
188 |
+
|
189 |
+
if($this->_isExport) {
|
190 |
+
$this->addColumn('email', array(
|
191 |
+
'header'=>Mage::helper('clarion_storelocator')->__('Email'),
|
192 |
+
'index'=>'email'
|
193 |
+
));
|
194 |
+
}
|
195 |
+
|
196 |
+
if($this->_isExport) {
|
197 |
+
$this->addColumn('store_logo', array(
|
198 |
+
'header'=>Mage::helper('clarion_storelocator')->__('Store Logo'),
|
199 |
+
'index'=>'store_logo'
|
200 |
+
));
|
201 |
+
}
|
202 |
+
|
203 |
+
if($this->_isExport) {
|
204 |
+
$this->addColumn('trading_hours', array(
|
205 |
+
'header'=>Mage::helper('clarion_storelocator')->__('Trading Hours'),
|
206 |
+
'index'=>'trading_hours'
|
207 |
+
));
|
208 |
+
}
|
209 |
+
|
210 |
+
if($this->_isExport) {
|
211 |
+
$this->addColumn('radius', array(
|
212 |
+
'header'=>Mage::helper('clarion_storelocator')->__('Radius'),
|
213 |
+
'index'=>'radius'
|
214 |
+
));
|
215 |
+
}
|
216 |
+
|
217 |
+
if($this->_isExport) {
|
218 |
+
$this->addColumn('latitude', array(
|
219 |
+
'header'=>Mage::helper('clarion_storelocator')->__('Latitude'),
|
220 |
+
'index'=>'latitude'
|
221 |
+
));
|
222 |
+
}
|
223 |
+
|
224 |
+
if($this->_isExport) {
|
225 |
+
$this->addColumn('longitude', array(
|
226 |
+
'header'=>Mage::helper('clarion_storelocator')->__('Longitude'),
|
227 |
+
'index'=>'longitude'
|
228 |
+
));
|
229 |
+
}
|
230 |
+
|
231 |
+
if($this->_isExport) {
|
232 |
+
$this->addColumn('zoom_level', array(
|
233 |
+
'header'=>Mage::helper('clarion_storelocator')->__('Zoom Level'),
|
234 |
+
'index'=>'zoom_level'
|
235 |
+
));
|
236 |
+
}
|
237 |
+
|
238 |
+
if($this->_isExport) {
|
239 |
+
$this->addColumn('description', array(
|
240 |
+
'header'=>Mage::helper('clarion_storelocator')->__('Description'),
|
241 |
+
'index'=>'description'
|
242 |
+
));
|
243 |
+
}
|
244 |
+
|
245 |
//Import Export functionality
|
246 |
$this->addExportType('*/*/exportCsv', Mage::helper('clarion_storelocator')->__('CSV'));
|
247 |
$this->addExportType('*/*/exportXml', Mage::helper('clarion_storelocator')->__('XML'));
|
app/code/community/Clarion/Storelocator/Block/Adminhtml/Storelocator/Renderer/Store.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Store renderer block
|
4 |
+
*
|
5 |
+
* @category Clarion
|
6 |
+
* @package Clarion_Storelocator
|
7 |
+
* @author Clarion Magento Team <magento@clariontechnologies.co.in>
|
8 |
+
*
|
9 |
+
*/
|
10 |
+
class Clarion_Storelocator_Block_Adminhtml_Storelocator_Renderer_Store extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
|
11 |
+
{
|
12 |
+
/**
|
13 |
+
* Renders store column
|
14 |
+
*
|
15 |
+
* @param Varien_Object $row
|
16 |
+
* @return string
|
17 |
+
*/
|
18 |
+
public function render(Varien_Object $row)
|
19 |
+
{
|
20 |
+
$storeCode = array();
|
21 |
+
|
22 |
+
if($row->getData($this->getColumn()->getIndex())==""){
|
23 |
+
return "";
|
24 |
+
}
|
25 |
+
else{
|
26 |
+
$storeIds = $row->getData($this->getColumn()->getIndex());
|
27 |
+
|
28 |
+
if(!is_array($storeIds)){
|
29 |
+
$storeIds = array($storeIds);
|
30 |
+
}
|
31 |
+
|
32 |
+
if(!empty($storeIds)){
|
33 |
+
foreach($storeIds as $storeId){
|
34 |
+
$storeCode[] = Mage::getModel('core/store')->load($storeId)->getCode();
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
return implode(",", $storeCode);
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}
|
app/code/community/Clarion/Storelocator/Helper/Data.php
CHANGED
@@ -126,4 +126,14 @@ class Clarion_Storelocator_Helper_Data extends Mage_Core_Helper_Abstract
|
|
126 |
$countryModel = Mage::getModel('directory/country')->loadByCode($countryCode);
|
127 |
return $countryName = $countryModel->getName();
|
128 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
}
|
126 |
$countryModel = Mage::getModel('directory/country')->loadByCode($countryCode);
|
127 |
return $countryName = $countryModel->getName();
|
128 |
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Maximum size of uploaded files.
|
132 |
+
*
|
133 |
+
* @return int
|
134 |
+
*/
|
135 |
+
public function getMaxUploadSize()
|
136 |
+
{
|
137 |
+
return min(ini_get('post_max_size'), ini_get('upload_max_filesize'));
|
138 |
+
}
|
139 |
}
|
app/code/community/Clarion/Storelocator/Helper/Validation.php
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* PHP validation helper
|
4 |
+
*
|
5 |
+
* @category Clarion
|
6 |
+
* @package Clarion_Storelocator
|
7 |
+
* @author Clarion Magento Team <magento@clariontechnologies.co.in>
|
8 |
+
*/
|
9 |
+
class Clarion_Storelocator_Helper_Validation extends Mage_Core_Helper_Abstract
|
10 |
+
{
|
11 |
+
/**
|
12 |
+
* check is valid image
|
13 |
+
* @param sting $imageName image
|
14 |
+
* @return boolean true/false
|
15 |
+
*/
|
16 |
+
public function isValidImage($imageName)
|
17 |
+
{
|
18 |
+
$allowededExtensions = array('jpg','jpeg','gif','png');
|
19 |
+
$fileExtension = pathinfo($imageName, PATHINFO_EXTENSION);
|
20 |
+
if(in_array($fileExtension, $allowededExtensions)){
|
21 |
+
return true;
|
22 |
+
}else{
|
23 |
+
return false;
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* check is valid store
|
29 |
+
* @param sting $stores stores (comma seperated)
|
30 |
+
* @return boolean true/false
|
31 |
+
*/
|
32 |
+
public function isValidStores($stores = '')
|
33 |
+
{
|
34 |
+
|
35 |
+
if(empty($stores)){
|
36 |
+
return false;
|
37 |
+
}
|
38 |
+
|
39 |
+
$storeCodes = explode(',', $stores);
|
40 |
+
foreach($storeCodes as $storeCode){
|
41 |
+
$storeId = Mage::getModel('core/store')->load($storeCode, 'code')->getId();
|
42 |
+
|
43 |
+
if (!is_numeric($storeId)) {
|
44 |
+
return false;
|
45 |
+
}
|
46 |
+
}
|
47 |
+
return true;
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* check is valid url string
|
52 |
+
* @param sting $url url
|
53 |
+
* @return boolean true/false
|
54 |
+
*/
|
55 |
+
public function isValidUrl($url = '')
|
56 |
+
{
|
57 |
+
if (!preg_match("/^(http|https|ftp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+.(com|org|net|dk|at|us|tv|info|uk|co.uk|biz|se)$)(:(\d+))?\/?/i", $url)) {
|
58 |
+
if (!preg_match("/^(www)((\.[A-Z0-9][A-Z0-9_-]*)+.(com|org|net|dk|at|us|tv|info|uk|co.uk|biz|se)$)(:(\d+))?\/?/i", $url)) {
|
59 |
+
return false;
|
60 |
+
} else {
|
61 |
+
return true;
|
62 |
+
}
|
63 |
+
} else {
|
64 |
+
return true;
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* check is valid email
|
70 |
+
* @param sting $email email
|
71 |
+
* @return boolean true/false
|
72 |
+
*/
|
73 |
+
public function isValidEmail($email='')
|
74 |
+
{
|
75 |
+
if (!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/", $email)) {
|
76 |
+
return false;
|
77 |
+
} else {
|
78 |
+
return true;
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
}
|
app/code/community/Clarion/Storelocator/Model/Resource/Storelocator.php
CHANGED
@@ -4,14 +4,32 @@
|
|
4 |
*
|
5 |
* @category Clarion
|
6 |
* @package Clarion_Storelocator
|
7 |
-
* @author Clarion Magento Team <
|
8 |
*
|
9 |
*/
|
10 |
class Clarion_Storelocator_Model_Resource_Storelocator extends Mage_Core_Model_Resource_Db_Abstract
|
11 |
{
|
12 |
/**
|
13 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
protected function _construct()
|
16 |
{
|
17 |
$this->_init('clarion_storelocator/storelocator', 'storelocator_id');
|
@@ -167,4 +185,310 @@ class Clarion_Storelocator_Model_Resource_Storelocator extends Mage_Core_Model_R
|
|
167 |
return $select;
|
168 |
}
|
169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
}
|
4 |
*
|
5 |
* @category Clarion
|
6 |
* @package Clarion_Storelocator
|
7 |
+
* @author Clarion Magento Team <magento@clariontechnologies.co.in>
|
8 |
*
|
9 |
*/
|
10 |
class Clarion_Storelocator_Model_Resource_Storelocator extends Mage_Core_Model_Resource_Db_Abstract
|
11 |
{
|
12 |
/**
|
13 |
+
* Errors in import process
|
14 |
+
*
|
15 |
+
* @var array
|
16 |
+
*/
|
17 |
+
protected $_importErrors = array();
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Count of imported stores
|
21 |
+
*
|
22 |
+
* @var int
|
23 |
*/
|
24 |
+
protected $_importedRows = 0;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Overwrite existing store(s)
|
28 |
+
* 1=yes, 0=no
|
29 |
+
* @var int
|
30 |
+
*/
|
31 |
+
protected $_behavior = 0;
|
32 |
+
|
33 |
protected function _construct()
|
34 |
{
|
35 |
$this->_init('clarion_storelocator/storelocator', 'storelocator_id');
|
185 |
return $select;
|
186 |
}
|
187 |
|
188 |
+
/**
|
189 |
+
* Upload store csv file and import data from it
|
190 |
+
*
|
191 |
+
* @throws Mage_Core_Exception
|
192 |
+
* @param Varien_Object $object
|
193 |
+
* @return Clarion_Storelocator_Model_Storelocator
|
194 |
+
*/
|
195 |
+
public function uploadAndImport($object)
|
196 |
+
{
|
197 |
+
$this->_behavior = $object->getRequest()->getPost('behavior');
|
198 |
+
$importFile = $_FILES['import_file'];
|
199 |
+
if (empty($importFile['tmp_name'])) {
|
200 |
+
return ;
|
201 |
+
}
|
202 |
+
|
203 |
+
$csvFile = $importFile['tmp_name'];
|
204 |
+
|
205 |
+
$this->_importErrors = array();
|
206 |
+
$this->_importedRows = 0;
|
207 |
+
|
208 |
+
$io = new Varien_Io_File();
|
209 |
+
$info = pathinfo($csvFile);
|
210 |
+
$io->open(array('path' => $info['dirname']));
|
211 |
+
$io->streamOpen($info['basename'], 'r');
|
212 |
+
|
213 |
+
// check and skip headers
|
214 |
+
$headers = $io->streamReadCsv();
|
215 |
+
if ($headers === false || count($headers) < 19) {
|
216 |
+
$io->streamClose();
|
217 |
+
Mage::throwException(Mage::helper('clarion_storelocator')->__('Invalid Stores File Format'));
|
218 |
+
}
|
219 |
+
|
220 |
+
$adapter = $this->_getWriteAdapter();
|
221 |
+
$adapter->beginTransaction();
|
222 |
+
try {
|
223 |
+
$rowNumber = 1;
|
224 |
+
$importData = array();
|
225 |
+
|
226 |
+
while (false !== ($csvLine = $io->streamReadCsv())) {
|
227 |
+
$rowNumber ++;
|
228 |
+
|
229 |
+
if (empty($csvLine)) {
|
230 |
+
continue;
|
231 |
+
}
|
232 |
+
|
233 |
+
$row = $this->_getImportRow($csvLine, $rowNumber);
|
234 |
+
|
235 |
+
if ($row !== false) {
|
236 |
+
$importData[] = $row;
|
237 |
+
}
|
238 |
+
|
239 |
+
if (count($importData) == 5000) {
|
240 |
+
$this->_saveImportData($importData);
|
241 |
+
$importData = array();
|
242 |
+
}
|
243 |
+
}
|
244 |
+
|
245 |
+
if ($this->_importErrors) {
|
246 |
+
$error = Mage::helper('clarion_storelocator')->__('File has not been imported. See the following list of errors: <br>%s', implode(" <br>", $this->_importErrors));
|
247 |
+
Mage::throwException($error);
|
248 |
+
}
|
249 |
+
|
250 |
+
if(empty($this->_importErrors)){
|
251 |
+
$this->_saveImportData($importData);
|
252 |
+
}
|
253 |
+
|
254 |
+
$io->streamClose();
|
255 |
+
} catch (Mage_Core_Exception $e) {
|
256 |
+
$adapter->rollback();
|
257 |
+
$io->streamClose();
|
258 |
+
Mage::throwException($e->getMessage());
|
259 |
+
} catch (Exception $e) {
|
260 |
+
$adapter->rollback();
|
261 |
+
$io->streamClose();
|
262 |
+
Mage::logException($e);
|
263 |
+
Mage::throwException(Mage::helper('clarion_storelocator')->__('An error occurred while import stores csv.'));
|
264 |
+
}
|
265 |
+
|
266 |
+
$adapter->commit();
|
267 |
+
|
268 |
+
//add success message
|
269 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('clarion_storelocator')->__($this->_importedRows.' - Rows imported successfully.'));
|
270 |
+
return $this;
|
271 |
+
}
|
272 |
+
|
273 |
+
/**
|
274 |
+
* Validate row for import and return stores array or false
|
275 |
+
* Error will be add to _importErrors array
|
276 |
+
*
|
277 |
+
* @param array $row
|
278 |
+
* @param int $rowNumber
|
279 |
+
* @return array|false
|
280 |
+
*/
|
281 |
+
protected function _getImportRow($row, $rowNumber = 0)
|
282 |
+
{
|
283 |
+
// validate row
|
284 |
+
if (count($row) < 18) {
|
285 |
+
$this->_importErrors[] = Mage::helper('clarion_storelocator')->__('Invalid stores format in the Row #%s', $rowNumber);
|
286 |
+
return false;
|
287 |
+
}
|
288 |
+
|
289 |
+
// strip whitespace from the beginning and end of each row
|
290 |
+
foreach ($row as $k => $v) {
|
291 |
+
$row[$k] = trim($v);
|
292 |
+
}
|
293 |
+
|
294 |
+
// validate store name
|
295 |
+
if(empty($row[0])){
|
296 |
+
$this->_importErrors[] = Mage::helper('clarion_storelocator')->__('Invalid Store Name "%s" in the Row #%s.', $row[0], $rowNumber);
|
297 |
+
return false;
|
298 |
+
}
|
299 |
+
// validate country
|
300 |
+
$countryId = '';
|
301 |
+
if(!empty($row[1])){
|
302 |
+
$countryId = $this->_getCountryCountryCode($row[1]);
|
303 |
+
}
|
304 |
+
if(empty($countryId) || ($countryId === false)){
|
305 |
+
$this->_importErrors[] = Mage::helper('shipping')->__('Invalid Country "%s" in the Row #%s.', $row[1], $rowNumber);
|
306 |
+
return false;
|
307 |
+
}
|
308 |
+
|
309 |
+
// validate state
|
310 |
+
if(empty($row[2])){
|
311 |
+
$this->_importErrors[] = Mage::helper('clarion_storelocator')->__('Invalid State "%s" in the Row #%s.', $row[2], $rowNumber);
|
312 |
+
return false;
|
313 |
+
}
|
314 |
+
|
315 |
+
// validate city
|
316 |
+
if(empty($row[3])){
|
317 |
+
$this->_importErrors[] = Mage::helper('clarion_storelocator')->__('Invalid City "%s" in the Row #%s.', $row[3], $rowNumber);
|
318 |
+
return false;
|
319 |
+
}
|
320 |
+
|
321 |
+
// validate Zipcode
|
322 |
+
if(empty($row[4])){
|
323 |
+
$this->_importErrors[] = Mage::helper('clarion_storelocator')->__('Invalid Zipcode "%s" in the Row #%s.', $row[4], $rowNumber);
|
324 |
+
return false;
|
325 |
+
}
|
326 |
+
|
327 |
+
// validate stores
|
328 |
+
$isValidStoreString = Mage::helper('clarion_storelocator/validation')->isValidStores($row[5]);
|
329 |
+
|
330 |
+
if($isValidStoreString === false){
|
331 |
+
$this->_importErrors[] = Mage::helper('clarion_storelocator')->__('Invalid Stores "%s" in the Row #%s.', $row[5], $rowNumber);
|
332 |
+
return false;
|
333 |
+
}
|
334 |
+
//get store ids from store code
|
335 |
+
$storeIds = array();
|
336 |
+
|
337 |
+
if(!empty($row[5])){
|
338 |
+
$storeCodes = explode(',', $row[5]);
|
339 |
+
foreach($storeCodes as $storeCode){
|
340 |
+
$storeId = Mage::getModel('core/store')->load($storeCode, 'code')->getId();
|
341 |
+
$storeIds[] = $storeId;
|
342 |
+
}
|
343 |
+
}
|
344 |
+
|
345 |
+
// validate Status
|
346 |
+
if($row[6] != 'Enable' && $row[6] != 'Disable'){
|
347 |
+
$this->_importErrors[] = Mage::helper('clarion_storelocator')->__('Invalid Status "%s" in the Row #%s.', $row[6], $rowNumber);
|
348 |
+
return false;
|
349 |
+
}
|
350 |
+
$status = ($row[6] == 'Enable') ? 1 :(($row[6] == 'Disable') ? 0 : '');
|
351 |
+
|
352 |
+
//validate url
|
353 |
+
if(!empty($row[10])){
|
354 |
+
$isValidSiteUrl = Mage::helper('clarion_storelocator/validation')->isValidUrl($row[10]);
|
355 |
+
if($isValidSiteUrl === false){
|
356 |
+
$this->_importErrors[] = Mage::helper('clarion_storelocator')->__('Invalid URL "%s" in the Row #%s.', $row[10], $rowNumber);
|
357 |
+
return false;
|
358 |
+
}
|
359 |
+
}
|
360 |
+
|
361 |
+
//validate email
|
362 |
+
if(!empty($row[11])){
|
363 |
+
$isValidEmailAddress = Mage::helper('clarion_storelocator/validation')->isValidEmail($row[11]);
|
364 |
+
if($isValidEmailAddress === false){
|
365 |
+
$this->_importErrors[] = Mage::helper('clarion_storelocator')->__('Invalid Email "%s" in the Row #%s.', $row[11], $rowNumber);
|
366 |
+
return false;
|
367 |
+
}
|
368 |
+
}
|
369 |
+
|
370 |
+
//validate image
|
371 |
+
if(!empty($row[12])){
|
372 |
+
$isValidImageName = Mage::helper('clarion_storelocator/validation')->isValidImage($row[12]);
|
373 |
+
if($isValidImageName === false){
|
374 |
+
$this->_importErrors[] = Mage::helper('clarion_storelocator')->__('Invalid Image "%s" in the Row #%s.', $row[12], $rowNumber);
|
375 |
+
return false;
|
376 |
+
}
|
377 |
+
}
|
378 |
+
//validate radius
|
379 |
+
if(!empty($row[14])){
|
380 |
+
if(!is_numeric($row[14])){
|
381 |
+
$this->_importErrors[] = Mage::helper('clarion_storelocator')->__('Invalid Radius "%s" in the Row #%s.', $row[14], $rowNumber);
|
382 |
+
return false;
|
383 |
+
}
|
384 |
+
}
|
385 |
+
|
386 |
+
//validate Latitude
|
387 |
+
if(!is_numeric($row[15])){
|
388 |
+
$this->_importErrors[] = Mage::helper('clarion_storelocator')->__('Invalid Latitude "%s" in the Row #%s.', $row[15], $rowNumber);
|
389 |
+
return false;
|
390 |
+
}
|
391 |
+
|
392 |
+
//validate Longitude
|
393 |
+
if(!is_numeric($row[16])){
|
394 |
+
$this->_importErrors[] = Mage::helper('clarion_storelocator')->__('Invalid Longitude "%s" in the Row #%s.', $row[16], $rowNumber);
|
395 |
+
return false;
|
396 |
+
}
|
397 |
+
|
398 |
+
//Zoom Level
|
399 |
+
if(!empty($row[17])){
|
400 |
+
if(!is_numeric($row[17])){
|
401 |
+
$this->_importErrors[] = Mage::helper('clarion_storelocator')->__('Invalid Zoom Level "%s" in the Row #%s.', $row[17], $rowNumber);
|
402 |
+
return false;
|
403 |
+
}
|
404 |
+
}
|
405 |
+
|
406 |
+
$storeRow = array(
|
407 |
+
'name' => $row[0],
|
408 |
+
'status' => $status,
|
409 |
+
'street_address' => $row[7],
|
410 |
+
'country' => $countryId,
|
411 |
+
'state' => $row[2],
|
412 |
+
'city' => $row[3],
|
413 |
+
'zipcode' => $row[4],
|
414 |
+
'phone' => $row[8],
|
415 |
+
'fax' => $row[9],
|
416 |
+
'url' => $row[10],
|
417 |
+
'email' => $row[11],
|
418 |
+
'store_logo' => $row[12],
|
419 |
+
'description' => $row[18],
|
420 |
+
'trading_hours' => $row[13],
|
421 |
+
'radius' => $row[14],
|
422 |
+
'latitude' => $row[15],
|
423 |
+
'longitude' => $row[16],
|
424 |
+
'zoom_level' => $row[17],
|
425 |
+
'stores' => $storeIds,
|
426 |
+
'created_at' => Mage::getModel('core/date')->timestamp(time()),
|
427 |
+
|
428 |
+
);
|
429 |
+
return $storeRow;
|
430 |
+
}
|
431 |
+
|
432 |
+
/**
|
433 |
+
* Get country code from country name
|
434 |
+
* @param sting $countryName counrty name
|
435 |
+
* @return string $countryId/false
|
436 |
+
*/
|
437 |
+
protected function _getCountryCountryCode($countryName)
|
438 |
+
{
|
439 |
+
$countryId = '';
|
440 |
+
$countryCollection = Mage::getModel('directory/country')->getCollection();
|
441 |
+
foreach ($countryCollection as $country) {
|
442 |
+
if ($countryName == $country->getName()) {
|
443 |
+
$countryId = $country->getCountryId();
|
444 |
+
break;
|
445 |
+
}
|
446 |
+
}
|
447 |
+
|
448 |
+
if(empty($countryId)){
|
449 |
+
return false;
|
450 |
+
}else{
|
451 |
+
return $countryId;
|
452 |
+
}
|
453 |
+
}
|
454 |
+
|
455 |
+
/**
|
456 |
+
* Save import data batch
|
457 |
+
*
|
458 |
+
* @param array $stores
|
459 |
+
* @return Clarion_Storelocator_Model_Resource_Storelocator
|
460 |
+
*/
|
461 |
+
protected function _saveImportData(array $stores)
|
462 |
+
{
|
463 |
+
if (!empty($stores)) {
|
464 |
+
$transactionSave = Mage::getModel('core/resource_transaction');
|
465 |
+
|
466 |
+
foreach($stores as $store){
|
467 |
+
$storelocatorId ='';
|
468 |
+
$storelocatorModel = Mage::getModel('clarion_storelocator/storelocator');
|
469 |
+
|
470 |
+
//check is store already exits
|
471 |
+
if(!empty($store['name'])) {
|
472 |
+
$storelocatorModel->load($store['name'],'name');
|
473 |
+
if($storelocatorModel->getId()){
|
474 |
+
$storelocatorId = $storelocatorModel->getId();
|
475 |
+
}
|
476 |
+
}
|
477 |
+
|
478 |
+
$storelocatorModel->setData($store);
|
479 |
+
|
480 |
+
if(!empty($storelocatorId)) {
|
481 |
+
$storelocatorModel->setStorelocatorId($storelocatorId);
|
482 |
+
}
|
483 |
+
|
484 |
+
//check for overwrite existing store(s)
|
485 |
+
if($this->_behavior == 1 || empty($storelocatorId)){
|
486 |
+
$transactionSave->addObject($storelocatorModel);
|
487 |
+
}
|
488 |
+
}
|
489 |
+
$transactionSave->save();
|
490 |
+
$this->_importedRows += count($stores);
|
491 |
+
}
|
492 |
+
return $this;
|
493 |
+
}
|
494 |
}
|
app/code/community/Clarion/Storelocator/Model/Storelocator.php
CHANGED
@@ -30,4 +30,19 @@ class Clarion_Storelocator_Model_Storelocator extends Mage_Core_Model_Abstract
|
|
30 |
return (is_array($result) && count($result) > 0) ? true : false;
|
31 |
}
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
}
|
30 |
return (is_array($result) && count($result) > 0) ? true : false;
|
31 |
}
|
32 |
|
33 |
+
/**
|
34 |
+
* Upload store csv file and import data from it
|
35 |
+
*
|
36 |
+
* @throws Mage_Core_Exception
|
37 |
+
* @param Varien_Object $object
|
38 |
+
* @return Clarion_Storelocator_Model_Storelocator
|
39 |
+
*/
|
40 |
+
public function uploadAndImport($object)
|
41 |
+
{
|
42 |
+
$resultObj = $this->_getResource()->uploadAndImport($object);
|
43 |
+
if($resultObj){
|
44 |
+
return $resultObj;
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
}
|
app/code/community/Clarion/Storelocator/controllers/Adminhtml/ImportstorelocatorController.php
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Import store locator admin controller
|
4 |
+
*
|
5 |
+
* @category Clarion
|
6 |
+
* @package Clarion_Storelocator
|
7 |
+
* @author Clarion Magento Team <magento@clariontechnologies.co.in>
|
8 |
+
*/
|
9 |
+
class Clarion_Storelocator_Adminhtml_ImportstorelocatorController extends Mage_Adminhtml_Controller_Action
|
10 |
+
{
|
11 |
+
/**
|
12 |
+
* Custom constructor.
|
13 |
+
*
|
14 |
+
* @return void
|
15 |
+
*/
|
16 |
+
protected function _construct()
|
17 |
+
{
|
18 |
+
// Define module dependent translate
|
19 |
+
$this->setUsedModuleName('Clarion_Storelocator');
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Initialize layout.
|
24 |
+
*
|
25 |
+
* @return Clarion_Storelocator_Adminhtml_ExportstorelocatorController
|
26 |
+
*/
|
27 |
+
protected function _initAction()
|
28 |
+
{
|
29 |
+
$this->_title($this->__('Import/Export'))
|
30 |
+
->loadLayout()
|
31 |
+
->_setActiveMenu('clarion_storelocator/import_export');
|
32 |
+
|
33 |
+
return $this;
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Check access (in the ACL) for current user
|
38 |
+
*
|
39 |
+
* @return bool
|
40 |
+
*/
|
41 |
+
protected function _isAllowed()
|
42 |
+
{
|
43 |
+
return Mage::getSingleton('admin/session')
|
44 |
+
->isAllowed('clarion_storelocator/import_export/import');
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Index action.
|
49 |
+
*
|
50 |
+
* @return void
|
51 |
+
*/
|
52 |
+
public function indexAction()
|
53 |
+
{
|
54 |
+
$maxUploadSize = Mage::helper('clarion_storelocator')->getMaxUploadSize();
|
55 |
+
$this->_getSession()->addNotice(
|
56 |
+
$this->__('Size - Total size of uploadable files must not exceed %s', $maxUploadSize)
|
57 |
+
);
|
58 |
+
$this->_getSession()->addNotice(
|
59 |
+
$this->__('Image - First upload image in the folder \'media/clarion_storelocator\' and then mention name of image in the csv file.')
|
60 |
+
);
|
61 |
+
$this->_getSession()->addNotice(
|
62 |
+
$this->__('Sample CSV File Format - First export stores and use exported csv file as sample csv file.')
|
63 |
+
);
|
64 |
+
$this->_initAction()
|
65 |
+
->_title($this->__('Import'))
|
66 |
+
->_addBreadcrumb($this->__('Import'), $this->__('Import'));
|
67 |
+
|
68 |
+
$this->renderLayout();
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Save action
|
73 |
+
*/
|
74 |
+
public function saveAction()
|
75 |
+
{
|
76 |
+
// check if data sent
|
77 |
+
if ($data = $this->getRequest()->getPost()) {
|
78 |
+
$session = Mage::getSingleton('adminhtml/session');
|
79 |
+
$importFile = $_FILES['import_file'];
|
80 |
+
try{
|
81 |
+
if ($importFile['error'] == 0){
|
82 |
+
//check for csv file
|
83 |
+
$fileExtension = pathinfo($importFile['name'], PATHINFO_EXTENSION);
|
84 |
+
if(!empty($fileExtension) && $fileExtension == 'csv'){
|
85 |
+
$resultObj = Mage::getModel('clarion_storelocator/storelocator')->uploadAndImport($this);
|
86 |
+
}else{
|
87 |
+
Mage::throwException(Mage::helper('clarion_storelocator')->__('Invalid File Format'));
|
88 |
+
}
|
89 |
+
}else{
|
90 |
+
Mage::throwException(Mage::helper('clarion_storelocator')->__('Error: ' . $importFile['error']));
|
91 |
+
}
|
92 |
+
} catch (Mage_Core_Exception $e) {
|
93 |
+
$session->addError($e->getMessage());
|
94 |
+
}
|
95 |
+
$this->_redirect('*/*/');
|
96 |
+
}
|
97 |
+
}
|
98 |
+
}
|
app/code/community/Clarion/Storelocator/controllers/Adminhtml/ManagestorelocatorController.php
CHANGED
@@ -456,6 +456,11 @@ class Clarion_Storelocator_Adminhtml_ManagestorelocatorController extends Mage_A
|
|
456 |
case 'delete':
|
457 |
return Mage::getSingleton('admin/session')->isAllowed('clarion_storelocator/clarion_manage_storelocator/delete');
|
458 |
break;
|
|
|
|
|
|
|
|
|
|
|
459 |
default:
|
460 |
return Mage::getSingleton('admin/session')->isAllowed('clarion_storelocator/clarion_manage_storelocator');
|
461 |
break;
|
456 |
case 'delete':
|
457 |
return Mage::getSingleton('admin/session')->isAllowed('clarion_storelocator/clarion_manage_storelocator/delete');
|
458 |
break;
|
459 |
+
|
460 |
+
case 'exportCsv':
|
461 |
+
case 'exportXml':
|
462 |
+
return Mage::getSingleton('admin/session')->isAllowed('clarion_storelocator/import_export/export');
|
463 |
+
break;
|
464 |
default:
|
465 |
return Mage::getSingleton('admin/session')->isAllowed('clarion_storelocator/clarion_manage_storelocator');
|
466 |
break;
|
app/code/community/Clarion/Storelocator/data/clarion_storelocator_setup/data-install-0.1.1.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @category Clarion
|
6 |
* @package Clarion_Storelocator
|
7 |
-
* @author Clarion Magento Team <
|
8 |
*
|
9 |
*/
|
10 |
/**
|
4 |
*
|
5 |
* @category Clarion
|
6 |
* @package Clarion_Storelocator
|
7 |
+
* @author Clarion Magento Team <magento@clariontechnologies.co.in>
|
8 |
*
|
9 |
*/
|
10 |
/**
|
app/code/community/Clarion/Storelocator/data/clarion_storelocator_setup/data-upgrade-0.1.0-0.1.1.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @category Clarion
|
6 |
* @package Clarion_Storelocator
|
7 |
-
* @author Clarion Magento Team <
|
8 |
*
|
9 |
*/
|
10 |
/**
|
4 |
*
|
5 |
* @category Clarion
|
6 |
* @package Clarion_Storelocator
|
7 |
+
* @author Clarion Magento Team <magento@clariontechnologies.co.in>
|
8 |
*
|
9 |
*/
|
10 |
/**
|
app/code/community/Clarion/Storelocator/etc/adminhtml.xml
CHANGED
@@ -25,6 +25,22 @@
|
|
25 |
<sort_order>2</sort_order>
|
26 |
<action>adminhtml/system_config/edit/section/clarion_storelocator_general_setting</action>
|
27 |
</clarion_storelocator_general_settings>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
</children>
|
29 |
</clarion_storelocator>
|
30 |
</menu>
|
@@ -59,6 +75,20 @@
|
|
59 |
<title>General Settings</title>
|
60 |
<sort_order>2</sort_order>
|
61 |
</clarion_storelocator_general_settings>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
</children>
|
63 |
</clarion_storelocator>
|
64 |
</children>
|
25 |
<sort_order>2</sort_order>
|
26 |
<action>adminhtml/system_config/edit/section/clarion_storelocator_general_setting</action>
|
27 |
</clarion_storelocator_general_settings>
|
28 |
+
<import_export translate="title" module="clarion_storelocator">
|
29 |
+
<title>Import/Export</title>
|
30 |
+
<sort_order>3</sort_order>
|
31 |
+
<children>
|
32 |
+
<export translate="title" module="clarion_storelocator">
|
33 |
+
<title>Export</title>
|
34 |
+
<sort_order>1</sort_order>
|
35 |
+
<action>adminhtml/managestorelocator</action>
|
36 |
+
</export>
|
37 |
+
<import translate="title" module="clarion_storelocator">
|
38 |
+
<title>Import</title>
|
39 |
+
<sort_order>2</sort_order>
|
40 |
+
<action>adminhtml/importstorelocator</action>
|
41 |
+
</import>
|
42 |
+
</children>
|
43 |
+
</import_export>
|
44 |
</children>
|
45 |
</clarion_storelocator>
|
46 |
</menu>
|
75 |
<title>General Settings</title>
|
76 |
<sort_order>2</sort_order>
|
77 |
</clarion_storelocator_general_settings>
|
78 |
+
<import_export translate="title" module="clarion_storelocator">
|
79 |
+
<title>Import/Export</title>
|
80 |
+
<sort_order>3</sort_order>
|
81 |
+
<children>
|
82 |
+
<export translate="title" module="clarion_storelocator">
|
83 |
+
<title>Export</title>
|
84 |
+
<sort_order>1</sort_order>
|
85 |
+
</export>
|
86 |
+
<import translate="title" module="clarion_storelocator">
|
87 |
+
<title>Import</title>
|
88 |
+
<sort_order>2</sort_order>
|
89 |
+
</import>
|
90 |
+
</children>
|
91 |
+
</import_export>
|
92 |
</children>
|
93 |
</clarion_storelocator>
|
94 |
</children>
|
app/code/community/Clarion/Storelocator/etc/config.xml
CHANGED
@@ -11,7 +11,7 @@
|
|
11 |
<config>
|
12 |
<modules>
|
13 |
<Clarion_Storelocator>
|
14 |
-
<version>0.1.
|
15 |
</Clarion_Storelocator>
|
16 |
</modules>
|
17 |
|
11 |
<config>
|
12 |
<modules>
|
13 |
<Clarion_Storelocator>
|
14 |
+
<version>0.1.2</version>
|
15 |
</Clarion_Storelocator>
|
16 |
</modules>
|
17 |
|
app/code/community/Clarion/Storelocator/sql/clarion_storelocator_setup/install-0.1.1.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @category Clarion
|
6 |
* @package Clarion_Storelocator
|
7 |
-
* @author Clarion Magento Team <
|
8 |
*
|
9 |
*/
|
10 |
/**
|
4 |
*
|
5 |
* @category Clarion
|
6 |
* @package Clarion_Storelocator
|
7 |
+
* @author Clarion Magento Team <magento@clariontechnologies.co.in>
|
8 |
*
|
9 |
*/
|
10 |
/**
|
app/code/community/Clarion/Storelocator/sql/clarion_storelocator_setup/install-0.1.2.php
ADDED
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Storelocator installation script
|
4 |
+
*
|
5 |
+
* @category Clarion
|
6 |
+
* @package Clarion_Storelocator
|
7 |
+
* @author Clarion Magento Team <magento@clariontechnologies.co.in>
|
8 |
+
*
|
9 |
+
*/
|
10 |
+
/**
|
11 |
+
* @var $installer Mage_Core_Model_Resource_Setup
|
12 |
+
*/
|
13 |
+
$installer = $this;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Prepare database for install
|
17 |
+
*/
|
18 |
+
$installer->startSetup();
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Create table 'clarion_storelocator/storelocator'
|
22 |
+
*/
|
23 |
+
$table = $installer->getConnection()
|
24 |
+
->newTable($installer->getTable('clarion_storelocator/storelocator'))
|
25 |
+
->addColumn('storelocator_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
26 |
+
'identity' => true,
|
27 |
+
'unsigned' => true,
|
28 |
+
'nullable' => false,
|
29 |
+
'primary' => true,
|
30 |
+
), 'Storelocator Id')
|
31 |
+
|
32 |
+
->addColumn('name', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
|
33 |
+
'nullable' => false,
|
34 |
+
), 'Store Name')
|
35 |
+
|
36 |
+
->addColumn('status', Varien_Db_Ddl_Table::TYPE_TINYINT, null, array(
|
37 |
+
'nullable' => false,
|
38 |
+
'default' => '1',
|
39 |
+
), 'Staus')
|
40 |
+
|
41 |
+
->addColumn('street_address', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
|
42 |
+
'nullable' => true,
|
43 |
+
'default' => null,
|
44 |
+
), 'Street Address')
|
45 |
+
|
46 |
+
->addColumn('country', Varien_Db_Ddl_Table::TYPE_TEXT, 64, array(
|
47 |
+
'nullable' => true,
|
48 |
+
'default' => null,
|
49 |
+
), 'Country')
|
50 |
+
|
51 |
+
->addColumn('state', Varien_Db_Ddl_Table::TYPE_TEXT, 64, array(
|
52 |
+
'nullable' => true,
|
53 |
+
'default' => null,
|
54 |
+
), 'State')
|
55 |
+
|
56 |
+
->addColumn('city', Varien_Db_Ddl_Table::TYPE_TEXT, 64, array(
|
57 |
+
'nullable' => true,
|
58 |
+
'default' => null,
|
59 |
+
), 'City')
|
60 |
+
|
61 |
+
->addColumn('zipcode', Varien_Db_Ddl_Table::TYPE_TEXT, 64, array(
|
62 |
+
'nullable' => true,
|
63 |
+
'default' => null,
|
64 |
+
), 'Zipcode')
|
65 |
+
|
66 |
+
->addColumn('phone', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
|
67 |
+
'nullable' => true,
|
68 |
+
'default' => null,
|
69 |
+
), 'Phone')
|
70 |
+
|
71 |
+
->addColumn('fax', Varien_Db_Ddl_Table::TYPE_TEXT, 64, array(
|
72 |
+
'nullable' => true,
|
73 |
+
'default' => null,
|
74 |
+
), 'Fax')
|
75 |
+
|
76 |
+
->addColumn('url', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
|
77 |
+
'nullable' => true,
|
78 |
+
'default' => null,
|
79 |
+
), 'Store Url')
|
80 |
+
|
81 |
+
->addColumn('email', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
|
82 |
+
'nullable' => true,
|
83 |
+
'default' => null,
|
84 |
+
), 'Email')
|
85 |
+
|
86 |
+
->addColumn('store_logo', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
|
87 |
+
'nullable' => true,
|
88 |
+
'default' => null,
|
89 |
+
), 'Store Logo')
|
90 |
+
|
91 |
+
->addColumn('description', Varien_Db_Ddl_Table::TYPE_TEXT, '64K', array(
|
92 |
+
'nullable' => true,
|
93 |
+
'default' => null,
|
94 |
+
), 'Description')
|
95 |
+
|
96 |
+
->addColumn('trading_hours', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
|
97 |
+
'nullable' => true,
|
98 |
+
'default' => null,
|
99 |
+
), 'Trading Hours')
|
100 |
+
|
101 |
+
->addColumn('radius', Varien_Db_Ddl_Table::TYPE_TEXT, 64, array(
|
102 |
+
'nullable' => true,
|
103 |
+
'default' => null,
|
104 |
+
), 'Radius')
|
105 |
+
|
106 |
+
->addColumn('latitude', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
|
107 |
+
'nullable' => true,
|
108 |
+
'default' => null,
|
109 |
+
), 'Latitude')
|
110 |
+
|
111 |
+
->addColumn('longitude', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
|
112 |
+
'nullable' => true,
|
113 |
+
'default' => null,
|
114 |
+
), 'Longitude')
|
115 |
+
|
116 |
+
->addColumn('zoom_level', Varien_Db_Ddl_Table::TYPE_TEXT, 64, array(
|
117 |
+
'nullable' => true,
|
118 |
+
'default' => null,
|
119 |
+
), 'Zoom level')
|
120 |
+
|
121 |
+
->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
|
122 |
+
'nullable' => true,
|
123 |
+
'default' => null,
|
124 |
+
), 'Creation Time')
|
125 |
+
|
126 |
+
->addColumn('updated_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
|
127 |
+
'nullable' => true,
|
128 |
+
'default' => null,
|
129 |
+
), 'Store Updated Date')
|
130 |
+
|
131 |
+
//Add unique index for column 'name'
|
132 |
+
->addIndex(
|
133 |
+
$installer->getIdxName(
|
134 |
+
'clarion_storelocator/storelocator',
|
135 |
+
array('name'),
|
136 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE
|
137 |
+
),
|
138 |
+
array('name'),
|
139 |
+
array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE))
|
140 |
+
|
141 |
+
->setComment('Clarion Storelocator Table');
|
142 |
+
|
143 |
+
$installer->getConnection()->createTable($table);
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Create table 'clarion_storelocator/storelocator_store'
|
147 |
+
*/
|
148 |
+
|
149 |
+
$table = $installer->getConnection()
|
150 |
+
->newTable($installer->getTable('clarion_storelocator/storelocator_store'))
|
151 |
+
->addColumn('storelocator_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
|
152 |
+
'nullable' => false,
|
153 |
+
'primary' => true,
|
154 |
+
), 'Storelocator ID')
|
155 |
+
->addColumn('store_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
|
156 |
+
'unsigned' => true,
|
157 |
+
'nullable' => false,
|
158 |
+
'primary' => true,
|
159 |
+
), 'Store ID')
|
160 |
+
->addIndex($installer->getIdxName('clarion_storelocator/storelocator_store', array('store_id')),
|
161 |
+
array('store_id'))
|
162 |
+
|
163 |
+
->addForeignKey($installer->getFkName('clarion_storelocator/storelocator_store', 'storelocator_id', 'clarion_storelocator/storelocator', 'storelocator_id'),
|
164 |
+
'storelocator_id', $installer->getTable('clarion_storelocator/storelocator'), 'storelocator_id',
|
165 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)
|
166 |
+
|
167 |
+
->addForeignKey($installer->getFkName('clarion_storelocator/storelocator_store', 'store_id', 'core/store', 'store_id'),
|
168 |
+
'store_id', $installer->getTable('core/store'), 'store_id',
|
169 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)
|
170 |
+
|
171 |
+
->setComment('Clarion Storelocator To Store Linkage Table');
|
172 |
+
$installer->getConnection()->createTable($table);
|
173 |
+
|
174 |
+
/**
|
175 |
+
* Prepare database after install
|
176 |
+
*/
|
177 |
+
$installer->endSetup();
|
app/code/community/Clarion/Storelocator/sql/clarion_storelocator_setup/upgrade-0.1.0-0.1.1.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @category Clarion
|
6 |
* @package Clarion_Storelocator
|
7 |
-
* @author Clarion Magento Team <
|
8 |
*
|
9 |
*/
|
10 |
/** @var $installer Mage_Core_Model_Resource_Setup */
|
4 |
*
|
5 |
* @category Clarion
|
6 |
* @package Clarion_Storelocator
|
7 |
+
* @author Clarion Magento Team <magento@clariontechnologies.co.in>
|
8 |
*
|
9 |
*/
|
10 |
/** @var $installer Mage_Core_Model_Resource_Setup */
|
app/code/community/Clarion/Storelocator/sql/clarion_storelocator_setup/upgrade-0.1.1-0.1.2.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Storelocator installation script
|
4 |
+
*
|
5 |
+
* @category Clarion
|
6 |
+
* @package Clarion_Storelocator
|
7 |
+
* @author Clarion Magento Team <magento@clariontechnologies.co.in>
|
8 |
+
*
|
9 |
+
*/
|
10 |
+
/** @var $installer Mage_Core_Model_Resource_Setup */
|
11 |
+
$installer = $this;
|
12 |
+
$installer->startSetup();
|
13 |
+
|
14 |
+
//Add unique index for column 'name'
|
15 |
+
$installer->getConnection()->addIndex(
|
16 |
+
$installer->getTable('clarion_storelocator/storelocator'),
|
17 |
+
$installer->getIdxName(
|
18 |
+
'clarion_storelocator/storelocator',
|
19 |
+
array('name'),
|
20 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE
|
21 |
+
),
|
22 |
+
array('name'),
|
23 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE
|
24 |
+
);
|
25 |
+
|
26 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/layout/clarion_storelocator.xml
CHANGED
@@ -38,4 +38,9 @@
|
|
38 |
<adminhtml_managestorelocator_edit>
|
39 |
<update handle="editor"/>
|
40 |
</adminhtml_managestorelocator_edit>
|
|
|
|
|
|
|
|
|
|
|
41 |
</layout>
|
38 |
<adminhtml_managestorelocator_edit>
|
39 |
<update handle="editor"/>
|
40 |
</adminhtml_managestorelocator_edit>
|
41 |
+
<adminhtml_importstorelocator_index>
|
42 |
+
<reference name="content">
|
43 |
+
<block type="clarion_storelocator/adminhtml_import_edit" name="importstorelocator.form.container"/>
|
44 |
+
</reference>
|
45 |
+
</adminhtml_importstorelocator_index>
|
46 |
</layout>
|
app/design/frontend/base/default/layout/clarion_storelocator.xml
CHANGED
@@ -38,7 +38,7 @@
|
|
38 |
</reference>
|
39 |
<reference name="root">
|
40 |
<action method="setTemplate">
|
41 |
-
<template>page/
|
42 |
</action>
|
43 |
<action method="setHeaderTitle" translate="title" module="clarion_storelocator">
|
44 |
<title>Storelocator</title>
|
@@ -68,7 +68,7 @@
|
|
68 |
</reference>
|
69 |
<reference name="root">
|
70 |
<action method="setTemplate">
|
71 |
-
<template>page/
|
72 |
</action>
|
73 |
</reference>
|
74 |
<reference name="content">
|
38 |
</reference>
|
39 |
<reference name="root">
|
40 |
<action method="setTemplate">
|
41 |
+
<template>page/1column.phtml</template>
|
42 |
</action>
|
43 |
<action method="setHeaderTitle" translate="title" module="clarion_storelocator">
|
44 |
<title>Storelocator</title>
|
68 |
</reference>
|
69 |
<reference name="root">
|
70 |
<action method="setTemplate">
|
71 |
+
<template>page/1column.phtml</template>
|
72 |
</action>
|
73 |
</reference>
|
74 |
<reference name="content">
|
app/design/frontend/base/default/template/clarion/storelocator/view.phtml
CHANGED
@@ -115,7 +115,7 @@
|
|
115 |
<?php if($_storeView->getRadius()): ?>
|
116 |
<tr>
|
117 |
<th class="label">Radius</th>
|
118 |
-
<td><?php echo $this->escapeHtml($_storeView->getRadius())
|
119 |
</tr>
|
120 |
<?php endif; ?>
|
121 |
<!-- Description -->
|
@@ -128,7 +128,7 @@
|
|
128 |
</tbody>
|
129 |
</table>
|
130 |
</td>
|
131 |
-
<td id="store-gmap" style="valign:top"><div id="googleMap"
|
132 |
</tr>
|
133 |
<tr><td> </td></tr>
|
134 |
<tr>
|
115 |
<?php if($_storeView->getRadius()): ?>
|
116 |
<tr>
|
117 |
<th class="label">Radius</th>
|
118 |
+
<td><?php echo $this->escapeHtml($_storeView->getRadius()) ?> Miles</td>
|
119 |
</tr>
|
120 |
<?php endif; ?>
|
121 |
<!-- Description -->
|
128 |
</tbody>
|
129 |
</table>
|
130 |
</td>
|
131 |
+
<td id="store-gmap" style="valign:top"><div id="googleMap"></div></td>
|
132 |
</tr>
|
133 |
<tr><td> </td></tr>
|
134 |
<tr>
|
media/clarion_storelocator/cache/400/demo2.png
DELETED
Binary file
|
media/clarion_storelocator/cache/400/demo4.png
DELETED
Binary file
|
media/clarion_storelocator/cache/400/demo5.png
DELETED
Binary file
|
media/clarion_storelocator/cache/400/red3.jpeg
DELETED
Binary file
|
media/clarion_storelocator/demo1.png
ADDED
Binary file
|
media/clarion_storelocator/demo5.png
ADDED
Binary file
|
package.xml
CHANGED
@@ -1,18 +1,20 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Clarion_Storelocator</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Store Locator With Google Map</summary>
|
10 |
-
<description>Store locator extension helps to manage multiple stores from admin panel. Customers can search nearest stores. Customers can view individual store details. Stores shown on the Google map.</description>
|
11 |
-
<notes>Added
|
|
|
|
|
12 |
<authors><author><name>Clarion Technologies</name><user>Clariontech</user><email>magento@clariontechnologies.co.in</email></author></authors>
|
13 |
-
<date>2014-07-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Clarion"><dir name="Storelocator"><dir name="Block"><dir name="Adminhtml"><dir name="Storelocator"><dir name="Edit"><file name="Form.php" hash="6ae73ab1e08b67ece7ef0b8090fa58ac"/><dir name="Tab"><file name="Description.php" hash="6d7713c768072d32e669f43e82ed43b6"/><file name="Display.php" hash="98f53775cdfff51f1b18594d769fd5cc"/><file name="Form.php" hash="ddb9c96ffdb1848badee1ac396a6028d"/><file name="Googlemap.PHP" hash="5f6a32c06b19e78b6a67a4f54e6c735f"/></dir><file name="Tabs.php" hash="ee6cf57f633fc54c41f2a0097b02292b"/></dir><file name="Edit.php" hash="b84a1b2280b0c7d765b93daac5a0ec54"/><file name="Grid.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Clarion_Storelocator</name>
|
4 |
+
<version>1.0.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Store Locator With Google Map</summary>
|
10 |
+
<description>Store locator extension helps to manage multiple stores from admin panel. Customers can search nearest stores. Customers can view individual store details. Stores shown on the Google map. Supports for multiple store view. Supports import/export stores.</description>
|
11 |
+
<notes>(1)Added Import/Export stores functionality
|
12 |
+
(2)Added Unique index for store name
|
13 |
+
(3)Updated design of store list and store detail page</notes>
|
14 |
<authors><author><name>Clarion Technologies</name><user>Clariontech</user><email>magento@clariontechnologies.co.in</email></author></authors>
|
15 |
+
<date>2014-07-29</date>
|
16 |
+
<time>09:33:33</time>
|
17 |
+
<contents><target name="magecommunity"><dir name="Clarion"><dir name="Storelocator"><dir name="Block"><dir name="Adminhtml"><dir name="Import"><dir name="Edit"><file name="Form.php" hash="6ec470c75a7817365050effc0fe6046f"/></dir><file name="Edit.php" hash="0c8541adbb34070b0549a7ca804d1d81"/></dir><dir name="Storelocator"><dir name="Edit"><file name="Form.php" hash="6ae73ab1e08b67ece7ef0b8090fa58ac"/><dir name="Tab"><file name="Description.php" hash="6d7713c768072d32e669f43e82ed43b6"/><file name="Display.php" hash="98f53775cdfff51f1b18594d769fd5cc"/><file name="Form.php" hash="ddb9c96ffdb1848badee1ac396a6028d"/><file name="Googlemap.PHP" hash="5f6a32c06b19e78b6a67a4f54e6c735f"/></dir><file name="Tabs.php" hash="ee6cf57f633fc54c41f2a0097b02292b"/></dir><file name="Edit.php" hash="b84a1b2280b0c7d765b93daac5a0ec54"/><file name="Grid.php" hash="fe822dc651ec194551786075136e66f2"/><dir name="Renderer"><file name="Store.php" hash="f3cfd26d5b7f01e66a6421bd18197139"/></dir></dir><file name="Storelocator.php" hash="8408bd9a6cd03628fbeb189b5ea25796"/></dir><file name="List.php" hash="30e86853e0fa4efe921bf015ba47be38"/><file name="View.php" hash="851850836d6bb8e4228a6173dce2375d"/></dir><dir name="Helper"><file name="Admin.php" hash="c3b93859c4e926afd7dfa1931b805040"/><file name="Data.php" hash="6bf6a5a44b11f9e07c20ce342a8f19d3"/><file name="Image.php" hash="f57436a272c1bd566239a52ea7429c5a"/><file name="Validation.php" hash="47897b064d004d9b770dc8f717e28b07"/></dir><dir name="Model"><file name="Enabledisable.php" hash="9a4274b006e955c1da42253260ec3fa3"/><dir name="Resource"><file name="Setup.php" hash="d626686cd920168f17d332b1edd3860d"/><dir name="Storelocator"><file name="Collection.php" hash="b4b795d05336b1f017768e56794dae62"/></dir><file name="Storelocator.php" hash="b5289329890c150d50b38a07e609ceba"/></dir><file name="Storelocator.php" hash="fc9a977fb89ccb2fce58b1c318807b81"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ImportstorelocatorController.php" hash="c805054dfc271b70c1a6735012b93d37"/><file name="ManagestorelocatorController.php" hash="593ad96d766c90205f12463e7d0ff86f"/></dir><file name="IndexController.php" hash="598df2ba06adbb249bac3b997e380194"/></dir><dir name="data"><dir name="clarion_storelocator_setup"><file name="data-install-0.1.0.php" hash="c1a712b8a0832f53afd0a9de4289ef61"/><file name="data-install-0.1.1.php" hash="26f84112531c7a3f463c7f703fbd38b3"/><file name="data-upgrade-0.1.0-0.1.1.php" hash="32aad2357ada0764498bf0bd2eec18c2"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="71196f77f2c01cbd3fcccdff704dcd6c"/><file name="config.xml" hash="21cce3910f6ac334a54008ba2b400a14"/><file name="system.xml" hash="b22b364f771a8d79762e468f438c040b"/></dir><dir name="sql"><dir name="clarion_storelocator_setup"><file name="install-0.1.0.php" hash="837a059b999021a4fca8714dae95ed7c"/><file name="install-0.1.1.php" hash="6e767237d609410abec098ca6241711e"/><file name="install-0.1.2.php" hash="7b6cfabccf7ee66d5d0058c3fc7d1a47"/><file name="upgrade-0.1.0-0.1.1.php" hash="32007b27b6a607ff5d127d90930d0c05"/><file name="upgrade-0.1.1-0.1.2.php" hash="fd6f8c21193b6a38ce965fd6975cef80"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="clarion_storelocator.xml" hash="0b3a47d1405cf86f13fb254928603874"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="clarion_storelocator.xml" hash="0927d8e08f2b3ed7785784114316ef47"/></dir><dir name="template"><dir name="clarion"><dir name="storelocator"><file name="list.phtml" hash="a321d7338a3317883487d55a825dd60b"/><file name="view.phtml" hash="c958d67df6dba70f76156a081f2932bc"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Clarion_Storelocator.xml" hash="64d157a8f5d3806f9294495058042a8b"/></dir></target><target name="magemedia"><dir name="clarion_storelocator"><file name="demo1.png" hash="36d5e5281767ac6ed3ed4373945a00a1"/><file name="demo2.png" hash="1e691b78821ad95c4fd12f2e66990f93"/><file name="demo3.png" hash="e821fde1f20f200dea31e9e9e39cddd7"/><file name="demo4.png" hash="1f90c8d847fd50d9062ac6fda4d9104d"/><file name="demo5.png" hash="098844050ba3cec618963253a3956c90"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="clarion_storelocator.css" hash="cab91d7dd2ae526625930c2cf13c1c3f"/></dir><dir name="js"><dir name="clarion_storelocator"><file name="storelocator.js" hash="cd71dbe51c5b86e8ab0f94a00660c3ce"/></dir></dir></dir></dir></dir></target></contents>
|
18 |
<compatible/>
|
19 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
20 |
</package>
|
skin/frontend/base/default/css/clarion_storelocator.css
CHANGED
@@ -14,21 +14,22 @@
|
|
14 |
#stores-list-div {
|
15 |
width: 48%;
|
16 |
float: left;
|
|
|
17 |
}
|
18 |
|
19 |
#stores-list-gmap-div {
|
20 |
width: 50%;
|
21 |
border: 1px solid silver;
|
22 |
-
float: right
|
23 |
-
|
24 |
position: relative;
|
25 |
overflow: hidden;
|
26 |
}
|
27 |
|
28 |
#store-list-map-canvas {
|
29 |
-
width:
|
30 |
height:600px;
|
31 |
-
|
32 |
}
|
33 |
|
34 |
#show-all-store {
|
@@ -101,7 +102,8 @@ padding: 5px 0px 5px 1px;
|
|
101 |
vertical-align: top;
|
102 |
border-top: 1px solid silver;
|
103 |
border-left: 1px solid silver;
|
104 |
-
|
|
|
105 |
}
|
106 |
#store-view-detail {
|
107 |
width: 100%;
|
@@ -111,10 +113,15 @@ padding: 5px 0px 5px 1px;
|
|
111 |
#store-gmap {
|
112 |
width: 50%;
|
113 |
vertical-align: top;
|
114 |
-
padding:
|
115 |
border: 1px solid silver;
|
116 |
}
|
117 |
|
|
|
|
|
|
|
|
|
|
|
118 |
#store-view-detail-table {
|
119 |
max-width: 50em;
|
120 |
}
|
14 |
#stores-list-div {
|
15 |
width: 48%;
|
16 |
float: left;
|
17 |
+
margin-right: 5px;
|
18 |
}
|
19 |
|
20 |
#stores-list-gmap-div {
|
21 |
width: 50%;
|
22 |
border: 1px solid silver;
|
23 |
+
/* float: right;*/
|
24 |
+
padding: 5px;
|
25 |
position: relative;
|
26 |
overflow: hidden;
|
27 |
}
|
28 |
|
29 |
#store-list-map-canvas {
|
30 |
+
width:100%;
|
31 |
height:600px;
|
32 |
+
/* float: right;*/
|
33 |
}
|
34 |
|
35 |
#show-all-store {
|
102 |
vertical-align: top;
|
103 |
border-top: 1px solid silver;
|
104 |
border-left: 1px solid silver;
|
105 |
+
border-bottom: 1px solid silver;
|
106 |
+
padding-bottom: 10px;
|
107 |
}
|
108 |
#store-view-detail {
|
109 |
width: 100%;
|
113 |
#store-gmap {
|
114 |
width: 50%;
|
115 |
vertical-align: top;
|
116 |
+
padding: 5px;
|
117 |
border: 1px solid silver;
|
118 |
}
|
119 |
|
120 |
+
#googleMap {
|
121 |
+
width: 100%;
|
122 |
+
height: 600px;
|
123 |
+
}
|
124 |
+
|
125 |
#store-view-detail-table {
|
126 |
max-width: 50em;
|
127 |
}
|