Version Notes
+ Calculate cost based on subtotal or total weight
+ Guest-only Mode
Download this release
Release Info
Developer | Fermo!Point |
Extension | fermopoint |
Version | 1.3.0 |
Comparing to | |
See all releases |
Code changes from version 1.2.2 to 1.3.0
- app/code/community/FermoPoint/StorePickup/Block/Adminhtml/Config/Cost/Subtotal.php +31 -0
- app/code/community/FermoPoint/StorePickup/Block/Adminhtml/Config/Cost/Weight.php +31 -0
- app/code/community/FermoPoint/StorePickup/Helper/Config.php +68 -0
- app/code/community/FermoPoint/StorePickup/Helper/Data.php +44 -0
- app/code/community/FermoPoint/StorePickup/Model/Carrier/Storepickup.php +1 -1
- app/code/community/FermoPoint/StorePickup/Model/Observer.php +2 -0
- app/code/community/FermoPoint/StorePickup/Model/Source/Costmode.php +42 -0
- app/code/community/FermoPoint/StorePickup/etc/config.xml +2 -1
- app/code/community/FermoPoint/StorePickup/etc/system.xml +47 -7
- app/design/adminhtml/default/default/template/fpstorepickup/array.phtml +165 -0
- app/design/frontend/base/default/template/fpstorepickup/map.phtml +14 -2
- js/fermopoint/storepickup.js +12 -6
- package.xml +6 -5
app/code/community/FermoPoint/StorePickup/Block/Adminhtml/Config/Cost/Subtotal.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FermoPoint_StorePickup_Block_Adminhtml_Config_Cost_Subtotal extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
public function getHtmlId()
|
7 |
+
{
|
8 |
+
return 'carriers_fpstorepickup_subtotal_cost';
|
9 |
+
}
|
10 |
+
|
11 |
+
public function __construct()
|
12 |
+
{
|
13 |
+
parent::__construct();
|
14 |
+
$this->setTemplate('fpstorepickup/array.phtml');
|
15 |
+
}
|
16 |
+
|
17 |
+
public function _prepareToRender()
|
18 |
+
{
|
19 |
+
$this->addColumn('subtotal', array(
|
20 |
+
'label' => Mage::helper('fpstorepickup')->__('Subtotal (less or equal)'),
|
21 |
+
'style' => 'width:100px',
|
22 |
+
));
|
23 |
+
$this->addColumn('cost', array(
|
24 |
+
'label' => Mage::helper('fpstorepickup')->__('Shipping Cost'),
|
25 |
+
'style' => 'width:100px',
|
26 |
+
));
|
27 |
+
|
28 |
+
$this->_addAfter = false;
|
29 |
+
$this->_addButtonLabel = Mage::helper('fpstorepickup')->__('Add Rule');
|
30 |
+
}
|
31 |
+
}
|
app/code/community/FermoPoint/StorePickup/Block/Adminhtml/Config/Cost/Weight.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FermoPoint_StorePickup_Block_Adminhtml_Config_Cost_Weight extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
public function getHtmlId()
|
7 |
+
{
|
8 |
+
return 'carriers_fpstorepickup_weight_cost';
|
9 |
+
}
|
10 |
+
|
11 |
+
public function __construct()
|
12 |
+
{
|
13 |
+
parent::__construct();
|
14 |
+
$this->setTemplate('fpstorepickup/array.phtml');
|
15 |
+
}
|
16 |
+
|
17 |
+
public function _prepareToRender()
|
18 |
+
{
|
19 |
+
$this->addColumn('weight', array(
|
20 |
+
'label' => Mage::helper('fpstorepickup')->__('Weight (less or equal)'),
|
21 |
+
'style' => 'width:100px',
|
22 |
+
));
|
23 |
+
$this->addColumn('cost', array(
|
24 |
+
'label' => Mage::helper('fpstorepickup')->__('Shipping Cost'),
|
25 |
+
'style' => 'width:100px',
|
26 |
+
));
|
27 |
+
|
28 |
+
$this->_addAfter = false;
|
29 |
+
$this->_addButtonLabel = Mage::helper('fpstorepickup')->__('Add Rule');
|
30 |
+
}
|
31 |
+
}
|
app/code/community/FermoPoint/StorePickup/Helper/Config.php
CHANGED
@@ -9,7 +9,10 @@ class FermoPoint_StorePickup_Helper_Config extends Mage_Core_Helper_Abstract
|
|
9 |
const ENDPOINT_SANDBOX = 'http://sandbox.fermopoint.it/api/v:api_version/:api_method';
|
10 |
|
11 |
const XML_PATH_ACCEPT = 'carriers/fpstorepickup/accept';
|
|
|
12 |
const XML_PATH_COST = 'carriers/fpstorepickup/cost';
|
|
|
|
|
13 |
const XML_PATH_SANDBOX = 'carriers/fpstorepickup/sandbox';
|
14 |
const XML_PATH_DEBUG = 'carriers/fpstorepickup/debug';
|
15 |
const XML_PATH_CLIENTID = 'carriers/fpstorepickup/client_id';
|
@@ -20,6 +23,7 @@ class FermoPoint_StorePickup_Helper_Config extends Mage_Core_Helper_Abstract
|
|
20 |
const XML_PATH_SPECIFICPAYMENTS = 'carriers/fpstorepickup/specificpayment';
|
21 |
const XML_PATH_AUTOSHIP = 'carriers/fpstorepickup/auto_ship';
|
22 |
const XML_PATH_GUEST = 'carriers/fpstorepickup/guest';
|
|
|
23 |
const XML_PATH_GUEST_NICKNAME = 'carriers/fpstorepickup/guest_nickname';
|
24 |
const XML_PATH_GUEST_DOB = 'carriers/fpstorepickup/guest_dob';
|
25 |
|
@@ -33,6 +37,11 @@ class FermoPoint_StorePickup_Helper_Config extends Mage_Core_Helper_Abstract
|
|
33 |
return Mage::getStoreConfigFlag(self::XML_PATH_GUEST);
|
34 |
}
|
35 |
|
|
|
|
|
|
|
|
|
|
|
36 |
public function resetGuestEnabled()
|
37 |
{
|
38 |
Mage::getModel('core/config')->saveConfig(self::XML_PATH_GUEST, 0);
|
@@ -83,11 +92,70 @@ class FermoPoint_StorePickup_Helper_Config extends Mage_Core_Helper_Abstract
|
|
83 |
return Mage::getStoreConfigFlag(self::XML_PATH_DEBUG);
|
84 |
}
|
85 |
|
|
|
|
|
|
|
|
|
|
|
86 |
public function getCost()
|
87 |
{
|
88 |
return (float) Mage::getStoreConfig(self::XML_PATH_COST);
|
89 |
}
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
public function getTosUrl()
|
92 |
{
|
93 |
return Mage::getStoreConfig(self::XML_PATH_TOSURL);
|
9 |
const ENDPOINT_SANDBOX = 'http://sandbox.fermopoint.it/api/v:api_version/:api_method';
|
10 |
|
11 |
const XML_PATH_ACCEPT = 'carriers/fpstorepickup/accept';
|
12 |
+
const XML_PATH_COST_MODE = 'carriers/fpstorepickup/cost_mode';
|
13 |
const XML_PATH_COST = 'carriers/fpstorepickup/cost';
|
14 |
+
const XML_PATH_SUBTOTAL_COST = 'carriers/fpstorepickup/subtotal_cost';
|
15 |
+
const XML_PATH_WEIGHT_COST = 'carriers/fpstorepickup/weight_cost';
|
16 |
const XML_PATH_SANDBOX = 'carriers/fpstorepickup/sandbox';
|
17 |
const XML_PATH_DEBUG = 'carriers/fpstorepickup/debug';
|
18 |
const XML_PATH_CLIENTID = 'carriers/fpstorepickup/client_id';
|
23 |
const XML_PATH_SPECIFICPAYMENTS = 'carriers/fpstorepickup/specificpayment';
|
24 |
const XML_PATH_AUTOSHIP = 'carriers/fpstorepickup/auto_ship';
|
25 |
const XML_PATH_GUEST = 'carriers/fpstorepickup/guest';
|
26 |
+
const XML_PATH_GUEST_ONLY = 'carriers/fpstorepickup/guest_only';
|
27 |
const XML_PATH_GUEST_NICKNAME = 'carriers/fpstorepickup/guest_nickname';
|
28 |
const XML_PATH_GUEST_DOB = 'carriers/fpstorepickup/guest_dob';
|
29 |
|
37 |
return Mage::getStoreConfigFlag(self::XML_PATH_GUEST);
|
38 |
}
|
39 |
|
40 |
+
public function getGuestOnly()
|
41 |
+
{
|
42 |
+
return $this->getGuestEnabled() && Mage::getStoreConfigFlag(self::XML_PATH_GUEST_ONLY);
|
43 |
+
}
|
44 |
+
|
45 |
public function resetGuestEnabled()
|
46 |
{
|
47 |
Mage::getModel('core/config')->saveConfig(self::XML_PATH_GUEST, 0);
|
92 |
return Mage::getStoreConfigFlag(self::XML_PATH_DEBUG);
|
93 |
}
|
94 |
|
95 |
+
public function getCostMode()
|
96 |
+
{
|
97 |
+
return (string) Mage::getStoreConfig(self::XML_PATH_COST_MODE);
|
98 |
+
}
|
99 |
+
|
100 |
public function getCost()
|
101 |
{
|
102 |
return (float) Mage::getStoreConfig(self::XML_PATH_COST);
|
103 |
}
|
104 |
|
105 |
+
protected function _cmpRules($rule1, $rule2)
|
106 |
+
{
|
107 |
+
if ($rule1['value'] < $rule2['value'])
|
108 |
+
return -1;
|
109 |
+
elseif ($rule1['value'] > $rule2['value'])
|
110 |
+
return 1;
|
111 |
+
else
|
112 |
+
return 0;
|
113 |
+
}
|
114 |
+
|
115 |
+
protected function _getCostRules($value, $key)
|
116 |
+
{
|
117 |
+
$rules = @unserialize($value);
|
118 |
+
if (is_array($rules))
|
119 |
+
{
|
120 |
+
$result = array();
|
121 |
+
foreach ($rules as $rule)
|
122 |
+
{
|
123 |
+
if ( ! isset($rule[$key]) || ! isset($rule['cost']))
|
124 |
+
continue;
|
125 |
+
|
126 |
+
$value = (float) $rule[$key];
|
127 |
+
if ($value <= 0)
|
128 |
+
continue;
|
129 |
+
|
130 |
+
$cost = (float) $rule['cost'];
|
131 |
+
$result[] = array(
|
132 |
+
'value' => $value,
|
133 |
+
'cost' => $cost,
|
134 |
+
);
|
135 |
+
}
|
136 |
+
|
137 |
+
if (count($rules))
|
138 |
+
$result[] = array('value' => 0, 'cost' => 0);
|
139 |
+
|
140 |
+
usort($result, array($this, '_cmpRules'));
|
141 |
+
}
|
142 |
+
else
|
143 |
+
$result = array();
|
144 |
+
return $result;
|
145 |
+
}
|
146 |
+
|
147 |
+
public function getSubtotalCost()
|
148 |
+
{
|
149 |
+
$value = Mage::getStoreConfig(self::XML_PATH_SUBTOTAL_COST);
|
150 |
+
return $this->_getCostRules($value, 'subtotal');
|
151 |
+
}
|
152 |
+
|
153 |
+
public function getWeightCost()
|
154 |
+
{
|
155 |
+
$value = Mage::getStoreConfig(self::XML_PATH_WEIGHT_COST);
|
156 |
+
return $this->_getCostRules($value, 'weight');
|
157 |
+
}
|
158 |
+
|
159 |
public function getTosUrl()
|
160 |
{
|
161 |
return Mage::getStoreConfig(self::XML_PATH_TOSURL);
|
app/code/community/FermoPoint/StorePickup/Helper/Data.php
CHANGED
@@ -180,4 +180,48 @@ class FermoPoint_StorePickup_Helper_Data extends Mage_Core_Helper_Abstract
|
|
180 |
|
181 |
return $dateObj->toString('yyyy-MM-dd');
|
182 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
}
|
180 |
|
181 |
return $dateObj->toString('yyyy-MM-dd');
|
182 |
}
|
183 |
+
|
184 |
+
protected function _getRulesCost($rules, $value)
|
185 |
+
{
|
186 |
+
$result = 0;
|
187 |
+
if (count($rules))
|
188 |
+
{
|
189 |
+
for ($i = 0; $i < count($rules) - 1; $i++)
|
190 |
+
{
|
191 |
+
$rule = $rules[$i];
|
192 |
+
$nextRule = $rules[$i + 1];
|
193 |
+
if ($value > $rule['value'] && $value <= $nextRule['value'])
|
194 |
+
{
|
195 |
+
$result = $nextRule['cost'];
|
196 |
+
break;
|
197 |
+
}
|
198 |
+
}
|
199 |
+
}
|
200 |
+
return $result;
|
201 |
+
}
|
202 |
+
|
203 |
+
public function getCost(Mage_Shipping_Model_Rate_Request $request)
|
204 |
+
{
|
205 |
+
$config = Mage::helper('fpstorepickup/config');
|
206 |
+
switch ($config->getCostMode())
|
207 |
+
{
|
208 |
+
case FermoPoint_StorePickup_Model_Source_Costmode::MODE_WEIGHT:
|
209 |
+
$weight = $request->getPackageWeight();
|
210 |
+
$rules = $config->getWeightCost();
|
211 |
+
$result = $this->_getRulesCost($rules, $weight);
|
212 |
+
break;
|
213 |
+
case FermoPoint_StorePickup_Model_Source_Costmode::MODE_SUBTOTAL:
|
214 |
+
$subtotal = $request->getBaseSubtotalInclTax();
|
215 |
+
$rules = $config->getSubtotalCost();
|
216 |
+
$result = $this->_getRulesCost($rules, $subtotal);
|
217 |
+
break;
|
218 |
+
case FermoPoint_StorePickup_Model_Source_Costmode::MODE_FLAT:
|
219 |
+
default:
|
220 |
+
$result = $config->getCost();
|
221 |
+
|
222 |
+
|
223 |
+
}
|
224 |
+
return $result;
|
225 |
+
}
|
226 |
+
|
227 |
}
|
app/code/community/FermoPoint/StorePickup/Model/Carrier/Storepickup.php
CHANGED
@@ -43,7 +43,7 @@ class FermoPoint_StorePickup_Model_Carrier_Storepickup
|
|
43 |
if ( ! $result)
|
44 |
return false;
|
45 |
|
46 |
-
$cost = Mage::helper('fpstorepickup
|
47 |
|
48 |
$result = Mage::getModel('shipping/rate_result');
|
49 |
$method = Mage::getModel('shipping/rate_result_method');
|
43 |
if ( ! $result)
|
44 |
return false;
|
45 |
|
46 |
+
$cost = Mage::helper('fpstorepickup')->getCost($request);
|
47 |
|
48 |
$result = Mage::getModel('shipping/rate_result');
|
49 |
$method = Mage::getModel('shipping/rate_result_method');
|
app/code/community/FermoPoint/StorePickup/Model/Observer.php
CHANGED
@@ -68,6 +68,8 @@ class FermoPoint_StorePickup_Model_Observer
|
|
68 |
|
69 |
$accountType = $request->getPost('fermopoint_account', 'new');
|
70 |
$config = Mage::helper('fpstorepickup/config');
|
|
|
|
|
71 |
if ($accountType == 'guest' && $config->getGuestEnabled())
|
72 |
{
|
73 |
$isGuest = true;
|
68 |
|
69 |
$accountType = $request->getPost('fermopoint_account', 'new');
|
70 |
$config = Mage::helper('fpstorepickup/config');
|
71 |
+
if ($config->getGuestOnly())
|
72 |
+
$accountType = 'guest';
|
73 |
if ($accountType == 'guest' && $config->getGuestEnabled())
|
74 |
{
|
75 |
$isGuest = true;
|
app/code/community/FermoPoint/StorePickup/Model/Source/Costmode.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FermoPoint_StorePickup_Model_Source_Costmode {
|
4 |
+
|
5 |
+
protected $_options;
|
6 |
+
|
7 |
+
const MODE_FLAT = 'flat';
|
8 |
+
const MODE_SUBTOTAL = 'subtotal';
|
9 |
+
const MODE_WEIGHT = 'weight';
|
10 |
+
|
11 |
+
public function toOptionArray()
|
12 |
+
{
|
13 |
+
if ( ! $this->_options)
|
14 |
+
{
|
15 |
+
$this->_options = array(
|
16 |
+
array(
|
17 |
+
'label' => Mage::helper('fpstorepickup')->__('Flat Rate (same for all)'),
|
18 |
+
'value' => self::MODE_FLAT,
|
19 |
+
),
|
20 |
+
array(
|
21 |
+
'label' => Mage::helper('fpstorepickup')->__('Based on Subtotal Value'),
|
22 |
+
'value' => self::MODE_SUBTOTAL,
|
23 |
+
),
|
24 |
+
array(
|
25 |
+
'label' => Mage::helper('fpstorepickup')->__('Based on Total Weight'),
|
26 |
+
'value' => self::MODE_WEIGHT,
|
27 |
+
),
|
28 |
+
);
|
29 |
+
}
|
30 |
+
|
31 |
+
return $this->_options;
|
32 |
+
}
|
33 |
+
|
34 |
+
public function toOptionMap()
|
35 |
+
{
|
36 |
+
$result = array();
|
37 |
+
foreach ($this->toOptionArray() as $option)
|
38 |
+
$result[$option['value']] = $option['label'];
|
39 |
+
return $result;
|
40 |
+
}
|
41 |
+
|
42 |
+
}
|
app/code/community/FermoPoint/StorePickup/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<FermoPoint_StorePickup>
|
5 |
-
<version>1.
|
6 |
</FermoPoint_StorePickup>
|
7 |
</modules>
|
8 |
<global>
|
@@ -235,6 +235,7 @@
|
|
235 |
<sandbox>1</sandbox>
|
236 |
<debug>1</debug>
|
237 |
<guest>0</guest>
|
|
|
238 |
<cost>0</cost>
|
239 |
<maximum_subtotal>500</maximum_subtotal>
|
240 |
<maximum_weight>15</maximum_weight>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<FermoPoint_StorePickup>
|
5 |
+
<version>1.3.0</version>
|
6 |
</FermoPoint_StorePickup>
|
7 |
</modules>
|
8 |
<global>
|
235 |
<sandbox>1</sandbox>
|
236 |
<debug>1</debug>
|
237 |
<guest>0</guest>
|
238 |
+
<cost_mode>flat></cost_mode>
|
239 |
<cost>0</cost>
|
240 |
<maximum_subtotal>500</maximum_subtotal>
|
241 |
<maximum_weight>15</maximum_weight>
|
app/code/community/FermoPoint/StorePickup/etc/system.xml
CHANGED
@@ -111,27 +111,47 @@
|
|
111 |
<show_in_store>0</show_in_store>
|
112 |
<depends><accept>1</accept></depends>
|
113 |
</guest>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
|
115 |
<guest_nickname translate="label">
|
116 |
<label>Guest Nickname</label>
|
117 |
<frontend_type>text</frontend_type>
|
118 |
-
<sort_order>
|
119 |
<show_in_default>1</show_in_default>
|
120 |
<show_in_website>1</show_in_website>
|
121 |
<show_in_store>0</show_in_store>
|
122 |
-
<depends><accept>1</accept></depends>
|
123 |
</guest_nickname>
|
124 |
<guest_dob translate="label comment">
|
125 |
<label>Guest Date of Birth</label>
|
126 |
<comment>YYYY-MM-DD</comment>
|
127 |
<frontend_type>text</frontend_type>
|
128 |
-
<sort_order>
|
129 |
<show_in_default>1</show_in_default>
|
130 |
<show_in_website>1</show_in_website>
|
131 |
<show_in_store>0</show_in_store>
|
132 |
-
<depends><accept>1</accept></depends>
|
133 |
</guest_dob>
|
134 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
<cost translate="label">
|
136 |
<label>Cost</label>
|
137 |
<frontend_type>text</frontend_type>
|
@@ -140,12 +160,32 @@
|
|
140 |
<show_in_default>1</show_in_default>
|
141 |
<show_in_website>1</show_in_website>
|
142 |
<show_in_store>0</show_in_store>
|
143 |
-
<depends><accept>1</accept></depends>
|
144 |
</cost>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
<maximum_subtotal translate="label">
|
146 |
<label>Maximum Subtotal</label>
|
147 |
<frontend_type>text</frontend_type>
|
148 |
-
<sort_order>
|
149 |
<validate>validate-number</validate>
|
150 |
<show_in_default>1</show_in_default>
|
151 |
<show_in_website>1</show_in_website>
|
@@ -155,7 +195,7 @@
|
|
155 |
<maximum_weight translate="label">
|
156 |
<label>Maximum Weight</label>
|
157 |
<frontend_type>text</frontend_type>
|
158 |
-
<sort_order>
|
159 |
<validate>validate-number</validate>
|
160 |
<show_in_default>1</show_in_default>
|
161 |
<show_in_website>1</show_in_website>
|
111 |
<show_in_store>0</show_in_store>
|
112 |
<depends><accept>1</accept></depends>
|
113 |
</guest>
|
114 |
+
<guest_only translate="label">
|
115 |
+
<label>Guest Only</label>
|
116 |
+
<frontend_type>select</frontend_type>
|
117 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
118 |
+
<sort_order>26</sort_order>
|
119 |
+
<show_in_default>1</show_in_default>
|
120 |
+
<show_in_website>1</show_in_website>
|
121 |
+
<show_in_store>0</show_in_store>
|
122 |
+
<depends><accept>1</accept><guest>1</guest></depends>
|
123 |
+
</guest_only>
|
124 |
|
125 |
<guest_nickname translate="label">
|
126 |
<label>Guest Nickname</label>
|
127 |
<frontend_type>text</frontend_type>
|
128 |
+
<sort_order>27</sort_order>
|
129 |
<show_in_default>1</show_in_default>
|
130 |
<show_in_website>1</show_in_website>
|
131 |
<show_in_store>0</show_in_store>
|
132 |
+
<depends><accept>1</accept><guest>1</guest></depends>
|
133 |
</guest_nickname>
|
134 |
<guest_dob translate="label comment">
|
135 |
<label>Guest Date of Birth</label>
|
136 |
<comment>YYYY-MM-DD</comment>
|
137 |
<frontend_type>text</frontend_type>
|
138 |
+
<sort_order>28</sort_order>
|
139 |
<show_in_default>1</show_in_default>
|
140 |
<show_in_website>1</show_in_website>
|
141 |
<show_in_store>0</show_in_store>
|
142 |
+
<depends><accept>1</accept><guest>1</guest></depends>
|
143 |
</guest_dob>
|
144 |
|
145 |
+
<cost_mode>
|
146 |
+
<label>Cost Mode</label>
|
147 |
+
<frontend_type>select</frontend_type>
|
148 |
+
<sort_order>29</sort_order>
|
149 |
+
<source_model>fpstorepickup/source_costmode</source_model>
|
150 |
+
<show_in_default>1</show_in_default>
|
151 |
+
<show_in_website>1</show_in_website>
|
152 |
+
<show_in_store>0</show_in_store>
|
153 |
+
<depends><accept>1</accept></depends>
|
154 |
+
</cost_mode>
|
155 |
<cost translate="label">
|
156 |
<label>Cost</label>
|
157 |
<frontend_type>text</frontend_type>
|
160 |
<show_in_default>1</show_in_default>
|
161 |
<show_in_website>1</show_in_website>
|
162 |
<show_in_store>0</show_in_store>
|
163 |
+
<depends><accept>1</accept><cost_mode>flat</cost_mode></depends>
|
164 |
</cost>
|
165 |
+
<subtotal_cost translate="label">
|
166 |
+
<label>Cost Rules</label>
|
167 |
+
<frontend_model>fpstorepickup/adminhtml_config_cost_subtotal</frontend_model>
|
168 |
+
<backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
|
169 |
+
<sort_order>31</sort_order>
|
170 |
+
<show_in_default>1</show_in_default>
|
171 |
+
<show_in_website>1</show_in_website>
|
172 |
+
<show_in_store>0</show_in_store>
|
173 |
+
<depends><accept>1</accept><cost_mode>subtotal</cost_mode></depends>
|
174 |
+
</subtotal_cost>
|
175 |
+
<weight_cost translate="label">
|
176 |
+
<label>Cost Rules</label>
|
177 |
+
<frontend_model>fpstorepickup/adminhtml_config_cost_weight</frontend_model>
|
178 |
+
<backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
|
179 |
+
<sort_order>32</sort_order>
|
180 |
+
<show_in_default>1</show_in_default>
|
181 |
+
<show_in_website>1</show_in_website>
|
182 |
+
<show_in_store>0</show_in_store>
|
183 |
+
<depends><accept>1</accept><cost_mode>weight</cost_mode></depends>
|
184 |
+
</weight_cost>
|
185 |
<maximum_subtotal translate="label">
|
186 |
<label>Maximum Subtotal</label>
|
187 |
<frontend_type>text</frontend_type>
|
188 |
+
<sort_order>35</sort_order>
|
189 |
<validate>validate-number</validate>
|
190 |
<show_in_default>1</show_in_default>
|
191 |
<show_in_website>1</show_in_website>
|
195 |
<maximum_weight translate="label">
|
196 |
<label>Maximum Weight</label>
|
197 |
<frontend_type>text</frontend_type>
|
198 |
+
<sort_order>36</sort_order>
|
199 |
<validate>validate-number</validate>
|
200 |
<show_in_default>1</show_in_default>
|
201 |
<show_in_website>1</show_in_website>
|
app/design/adminhtml/default/default/template/fpstorepickup/array.phtml
ADDED
@@ -0,0 +1,165 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magento.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magento.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package default_default
|
23 |
+
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
|
28 |
+
<?php
|
29 |
+
$_htmlId = $this->getHtmlId() ? $this->getHtmlId() : '_' . uniqid();
|
30 |
+
|
31 |
+
$_colspan = 2;
|
32 |
+
if (!$this->_addAfter) {
|
33 |
+
$_colspan -= 1;
|
34 |
+
}
|
35 |
+
$_colspan = $_colspan > 1 ? 'colspan="' . $_colspan . '"' : '';
|
36 |
+
?>
|
37 |
+
|
38 |
+
<a id="<?php echo $_htmlId ?>"></a>
|
39 |
+
<div class="grid" id="grid<?php echo $_htmlId ?>">
|
40 |
+
<table cellpadding="0" cellspacing="0" class="border">
|
41 |
+
<tbody>
|
42 |
+
|
43 |
+
<tr class="headings" id="headings<?php echo $_htmlId ?>">
|
44 |
+
<?php foreach ($this->_columns as $columnName => $column):?>
|
45 |
+
<th><?php echo $column['label'] ?></th>
|
46 |
+
<?php endforeach;?>
|
47 |
+
<th <?php echo $_colspan?>></th>
|
48 |
+
</tr>
|
49 |
+
|
50 |
+
<tr id="addRow<?php echo $_htmlId ?>">
|
51 |
+
<td colspan="<?php echo count($this->_columns) ?>"></td>
|
52 |
+
<td <?php echo $_colspan?>>
|
53 |
+
<button style="" onclick="" class="scalable add" type="button" id="addToEndBtn<?php echo $_htmlId ?>">
|
54 |
+
<span><span><span><?php echo $this->_addButtonLabel ?></span></span></span>
|
55 |
+
</button>
|
56 |
+
</td>
|
57 |
+
</tr>
|
58 |
+
|
59 |
+
</tbody>
|
60 |
+
</table>
|
61 |
+
<input type="hidden" name="<?php echo $this->getElement()->getName() ?>[__empty]" value="" />
|
62 |
+
</div>
|
63 |
+
<div id="empty<?php echo $_htmlId ?>">
|
64 |
+
<button style="" onclick="" class="scalable add" type="button" id="emptyAddBtn<?php echo $_htmlId ?>">
|
65 |
+
<span><span><span><?php echo $this->_addButtonLabel ?></span></span></span>
|
66 |
+
</button>
|
67 |
+
</div>
|
68 |
+
|
69 |
+
<script type="text/javascript">
|
70 |
+
//<![CDATA[
|
71 |
+
// create row creator
|
72 |
+
var arrayRow<?php echo $_htmlId ?> = {
|
73 |
+
// define row prototypeJS template
|
74 |
+
template : new Template(
|
75 |
+
'<tr id="#{_id}">'
|
76 |
+
<?php foreach ($this->_columns as $columnName => $column):?>
|
77 |
+
+'<td>'
|
78 |
+
+'<?php echo $this->_renderCellTemplate($columnName)?>'
|
79 |
+
+'<\/td>'
|
80 |
+
<?php endforeach;?>
|
81 |
+
<?php if ($this->_addAfter):?>
|
82 |
+
+'<td><button onclick="" class="scalable add" type="button" id="addAfterBtn#{_id}"><span><span><span><?php echo Mage::helper('adminhtml')->__('Add after') ?><\/span><\/span><\/span><\/button><\/td>'
|
83 |
+
<?php endif;?>
|
84 |
+
+'<td><button onclick="arrayRow<?php echo $_htmlId ?>.del(\'#{_id}\')" class="scalable delete" type="button"><span><span><span><?php echo Mage::helper('adminhtml')->__('Delete') ?><\/span><\/span><\/span><\/button><\/td>'
|
85 |
+
+'<\/tr>'
|
86 |
+
),
|
87 |
+
|
88 |
+
rowsCount : 0,
|
89 |
+
|
90 |
+
add : function(templateData, insertAfterId)
|
91 |
+
{
|
92 |
+
// generate default template data
|
93 |
+
if ('' == templateData) {
|
94 |
+
var d = new Date();
|
95 |
+
var templateData = {
|
96 |
+
<?php foreach ($this->_columns as $columnName => $column):?>
|
97 |
+
<?php echo $columnName ?> : '',
|
98 |
+
<?php endforeach;?>
|
99 |
+
_id : '_' + d.getTime() + '_' + d.getMilliseconds()
|
100 |
+
};
|
101 |
+
}
|
102 |
+
|
103 |
+
// insert before last row
|
104 |
+
if ('' == insertAfterId) {
|
105 |
+
Element.insert($('addRow<?php echo $_htmlId ?>'), {before: this.template.evaluate(templateData)});
|
106 |
+
}
|
107 |
+
// insert after specified row
|
108 |
+
else {
|
109 |
+
Element.insert($(insertAfterId), {after: this.template.evaluate(templateData)});
|
110 |
+
}
|
111 |
+
|
112 |
+
<?php if ($this->_addAfter):?>
|
113 |
+
Event.observe('addAfterBtn' + templateData._id, 'click', this.add.bind(this, '', templateData._id));
|
114 |
+
<?php endif;?>
|
115 |
+
|
116 |
+
this.rowsCount += 1;
|
117 |
+
},
|
118 |
+
|
119 |
+
del : function(rowId)
|
120 |
+
{
|
121 |
+
$(rowId).remove();
|
122 |
+
this.rowsCount -= 1;
|
123 |
+
if (0 == this.rowsCount) {
|
124 |
+
this.showButtonOnly();
|
125 |
+
}
|
126 |
+
},
|
127 |
+
|
128 |
+
showButtonOnly : function()
|
129 |
+
{
|
130 |
+
$('grid<?php echo $_htmlId ?>').hide();
|
131 |
+
$('empty<?php echo $_htmlId ?>').show();
|
132 |
+
}
|
133 |
+
}
|
134 |
+
|
135 |
+
// bind add action to "Add" button in last row
|
136 |
+
Event.observe('addToEndBtn<?php echo $_htmlId ?>', 'click', arrayRow<?php echo $_htmlId ?>.add.bind(arrayRow<?php echo $_htmlId ?>, '', ''));
|
137 |
+
|
138 |
+
// add existing rows
|
139 |
+
<?php
|
140 |
+
$_addAfterId = "headings{$_htmlId}";
|
141 |
+
foreach ($this->getArrayRows() as $_rowId => $_row) {
|
142 |
+
echo "arrayRow{$_htmlId}.add(" . $_row->toJson() . ", '{$_addAfterId}');\n";
|
143 |
+
$_addAfterId = $_rowId;
|
144 |
+
}
|
145 |
+
?>
|
146 |
+
|
147 |
+
// initialize standalone button
|
148 |
+
$('empty<?php echo $_htmlId ?>').hide();
|
149 |
+
Event.observe('emptyAddBtn<?php echo $_htmlId ?>', 'click', function () {
|
150 |
+
$('grid<?php echo $_htmlId ?>').show();
|
151 |
+
$('empty<?php echo $_htmlId ?>').hide();
|
152 |
+
arrayRow<?php echo $_htmlId ?>.add('', '');
|
153 |
+
});
|
154 |
+
|
155 |
+
// if no rows, hide grid and show button only
|
156 |
+
<?php if (!$this->getArrayRows()):?>
|
157 |
+
arrayRow<?php echo $_htmlId ?>.showButtonOnly();
|
158 |
+
<?php endif;?>
|
159 |
+
|
160 |
+
// toggle the grid, if element is disabled (depending on scope)
|
161 |
+
<?php if ($this->getElement()->getDisabled()):?>
|
162 |
+
toggleValueElements({checked:true}, $('grid<?php echo $_htmlId ?>').parentNode);
|
163 |
+
<?php endif;?>
|
164 |
+
//]]>
|
165 |
+
</script>
|
app/design/frontend/base/default/template/fpstorepickup/map.phtml
CHANGED
@@ -21,7 +21,7 @@
|
|
21 |
</div>
|
22 |
</div>
|
23 |
<div class="fermopoint-search">
|
24 |
-
<button id="fermopoint_search" class="button"><span><span><?php echo $this->__('Search') ?></span></span></button>
|
25 |
<img src="<?php echo $this->getSkinUrl('fermopoint/images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading') ?>" />
|
26 |
</div>
|
27 |
</div>
|
@@ -33,6 +33,7 @@
|
|
33 |
<h5 id="fermopoint_point_name"></h5>
|
34 |
<p id="fermopoint_point_address"></p>
|
35 |
<ul class="form-list">
|
|
|
36 |
<li class="control">
|
37 |
<input type="radio" name="fermopoint_account" id="fermopoint_account:new" value="new" title="<?php echo $this->__('I did not use Fermo!Point before') ?>" onclick="$$('.fermopoint-new-account, .fermopoint-account').each(function (el) {el.show()});$$('.fermopoint-existing-account,.fermopoint-guest').each(function (el) {el.hide()});" checked="checked" class="radio" /><label for="fermopoint_account:new"><?php echo $this->__('I did not use Fermo!Point before') ?></label></li>
|
38 |
</li>
|
@@ -44,6 +45,12 @@
|
|
44 |
<input type="radio" name="fermopoint_account" id="fermopoint_account:guest" value="guest" title="<?php echo $this->__('Check out as guest') ?>" onclick="$$('.fermopoint-new-account,.fermopoint-account').each(function (el) {el.hide()});$$('.fermopoint-existing-account,.fermopoint-guest').each(function (el) {el.show()});" class="radio" /><label for="fermopoint_account:guest"><?php echo $this->__('Delivery as HOST of %s. You will use the service without any registration.', Mage::app()->getStore()->getFrontendName()) ?></label></li>
|
45 |
</li>
|
46 |
<?php endif ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
<li class="fields fermopoint-account">
|
48 |
<div class="field">
|
49 |
<label for="fermopoint_nickname" class="required"><em>*</em><?php echo $this->__('Nickname') ?></label>
|
@@ -64,6 +71,7 @@
|
|
64 |
</div>
|
65 |
</div>
|
66 |
</li>
|
|
|
67 |
<li class="fields">
|
68 |
<div class="field">
|
69 |
<label for="fermopoint_phone"><?php echo $this->__('Mobile phone') ?></label>
|
@@ -74,6 +82,7 @@
|
|
74 |
</div>
|
75 |
</li>
|
76 |
</ul>
|
|
|
77 |
<div class="fermopoint-account">
|
78 |
<p class="fermopoint-new-account">
|
79 |
<?php echo $this->__('The billing information will be disclosed to Fermo!Point to register the new account and the user will be used in the future on any other site that integrates eCommerce service Fermo!Point') ?>
|
@@ -96,6 +105,7 @@
|
|
96 |
</div>
|
97 |
<?php endif ?>
|
98 |
</div>
|
|
|
99 |
<div class="fermopoint-guest" style="display: none;">
|
100 |
<p class="guest-account" style="display: none;">
|
101 |
<?php echo $this->__('You will check out as guest.') ?>
|
@@ -159,13 +169,14 @@
|
|
159 |
Event.observe('fermopoint_search', 'click', function (event) {
|
160 |
event.preventDefault();
|
161 |
if ($(this).hasClassName('in-progress')) {
|
162 |
-
alert('<?php echo $this->__('Another search is already running') ?>');
|
163 |
return;
|
164 |
}
|
165 |
|
166 |
fpStorePickup.search($('fermopoint_search_address').value, $('fermopoint_search_radius').value);
|
167 |
});
|
168 |
|
|
|
169 |
Calendar.setup({
|
170 |
inputField: "fermopoint_dob",
|
171 |
ifFormat: "<?php echo Mage::app()->getLocale()->getDateStrFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT) ?>",
|
@@ -174,5 +185,6 @@
|
|
174 |
align: "Bl",
|
175 |
singleClick : true
|
176 |
});
|
|
|
177 |
//]]>
|
178 |
</script>
|
21 |
</div>
|
22 |
</div>
|
23 |
<div class="fermopoint-search">
|
24 |
+
<button id="fermopoint_search" type="button" class="button"><span><span><?php echo $this->__('Search') ?></span></span></button>
|
25 |
<img src="<?php echo $this->getSkinUrl('fermopoint/images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading') ?>" />
|
26 |
</div>
|
27 |
</div>
|
33 |
<h5 id="fermopoint_point_name"></h5>
|
34 |
<p id="fermopoint_point_address"></p>
|
35 |
<ul class="form-list">
|
36 |
+
<?php if ( ! Mage::helper('fpstorepickup/config')->getGuestOnly()) : ?>
|
37 |
<li class="control">
|
38 |
<input type="radio" name="fermopoint_account" id="fermopoint_account:new" value="new" title="<?php echo $this->__('I did not use Fermo!Point before') ?>" onclick="$$('.fermopoint-new-account, .fermopoint-account').each(function (el) {el.show()});$$('.fermopoint-existing-account,.fermopoint-guest').each(function (el) {el.hide()});" checked="checked" class="radio" /><label for="fermopoint_account:new"><?php echo $this->__('I did not use Fermo!Point before') ?></label></li>
|
39 |
</li>
|
45 |
<input type="radio" name="fermopoint_account" id="fermopoint_account:guest" value="guest" title="<?php echo $this->__('Check out as guest') ?>" onclick="$$('.fermopoint-new-account,.fermopoint-account').each(function (el) {el.hide()});$$('.fermopoint-existing-account,.fermopoint-guest').each(function (el) {el.show()});" class="radio" /><label for="fermopoint_account:guest"><?php echo $this->__('Delivery as HOST of %s. You will use the service without any registration.', Mage::app()->getStore()->getFrontendName()) ?></label></li>
|
46 |
</li>
|
47 |
<?php endif ?>
|
48 |
+
<?php else : ?>
|
49 |
+
<li class="control">
|
50 |
+
<input type="radio" name="fermopoint_account" id="fermopoint_account:guest" value="guest" title="<?php echo $this->__('Check out as guest') ?>" checked="checked" class="radio" /><label for="fermopoint_account:guest"><?php echo $this->__('Delivery as HOST of %s. You will use the service without any registration.', Mage::app()->getStore()->getFrontendName()) ?></label></li>
|
51 |
+
</li>
|
52 |
+
<?php endif ?>
|
53 |
+
<?php if ( ! Mage::helper('fpstorepickup/config')->getGuestOnly()) : ?>
|
54 |
<li class="fields fermopoint-account">
|
55 |
<div class="field">
|
56 |
<label for="fermopoint_nickname" class="required"><em>*</em><?php echo $this->__('Nickname') ?></label>
|
71 |
</div>
|
72 |
</div>
|
73 |
</li>
|
74 |
+
<?php endif ?>
|
75 |
<li class="fields">
|
76 |
<div class="field">
|
77 |
<label for="fermopoint_phone"><?php echo $this->__('Mobile phone') ?></label>
|
82 |
</div>
|
83 |
</li>
|
84 |
</ul>
|
85 |
+
<?php if ( ! Mage::helper('fpstorepickup/config')->getGuestOnly()) : ?>
|
86 |
<div class="fermopoint-account">
|
87 |
<p class="fermopoint-new-account">
|
88 |
<?php echo $this->__('The billing information will be disclosed to Fermo!Point to register the new account and the user will be used in the future on any other site that integrates eCommerce service Fermo!Point') ?>
|
105 |
</div>
|
106 |
<?php endif ?>
|
107 |
</div>
|
108 |
+
<?php endif ?>
|
109 |
<div class="fermopoint-guest" style="display: none;">
|
110 |
<p class="guest-account" style="display: none;">
|
111 |
<?php echo $this->__('You will check out as guest.') ?>
|
169 |
Event.observe('fermopoint_search', 'click', function (event) {
|
170 |
event.preventDefault();
|
171 |
if ($(this).hasClassName('in-progress')) {
|
172 |
+
//alert('<?php echo $this->__('Another search is already running') ?>');
|
173 |
return;
|
174 |
}
|
175 |
|
176 |
fpStorePickup.search($('fermopoint_search_address').value, $('fermopoint_search_radius').value);
|
177 |
});
|
178 |
|
179 |
+
<?php if ( ! Mage::helper('fpstorepickup/config')->getGuestOnly()) : ?>
|
180 |
Calendar.setup({
|
181 |
inputField: "fermopoint_dob",
|
182 |
ifFormat: "<?php echo Mage::app()->getLocale()->getDateStrFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT) ?>",
|
185 |
align: "Bl",
|
186 |
singleClick : true
|
187 |
});
|
188 |
+
<?php endif ?>
|
189 |
//]]>
|
190 |
</script>
|
js/fermopoint/storepickup.js
CHANGED
@@ -110,16 +110,20 @@ FermopointStorePickup.prototype = {
|
|
110 |
this.nicknameUrl = nicknameUrl;
|
111 |
this.dobUrl = dobUrl;
|
112 |
|
113 |
-
|
114 |
-
|
|
|
|
|
115 |
if (guestAccount)
|
116 |
-
guestAccount.
|
117 |
|
118 |
Validation.add('validate-fp-nickname', 'User with this nickname already exists', this.validateNickname.bind(this));
|
119 |
Validation.add('validate-fp-dob', 'There is no user with given nickname and date of birth', this.validateDob.bind(this));
|
120 |
|
121 |
-
|
122 |
-
|
|
|
|
|
123 |
},
|
124 |
|
125 |
setUpHook: function () {
|
@@ -184,6 +188,8 @@ FermopointStorePickup.prototype = {
|
|
184 |
for (var i = 0; i < point.hours.length; i++) {
|
185 |
days.push('<span class="dow">' + point.hours[i].day + '</span>' + point.hours[i].hours.join(', '));
|
186 |
}
|
|
|
|
|
187 |
if (typeof this.infoCallback === 'function')
|
188 |
content = this.infoCallback(point);
|
189 |
else
|
@@ -201,7 +207,7 @@ FermopointStorePickup.prototype = {
|
|
201 |
},
|
202 |
|
203 |
calcDistance: function(p1, p2) {
|
204 |
-
return (google.maps.geometry.spherical.computeDistanceBetween(p1, p2) / 1000).toFixed(
|
205 |
},
|
206 |
|
207 |
addMarker: function (point) {
|
110 |
this.nicknameUrl = nicknameUrl;
|
111 |
this.dobUrl = dobUrl;
|
112 |
|
113 |
+
if (newAccount)
|
114 |
+
newAccount.observe('change', this.onAccountTypeChange.bind(this));
|
115 |
+
if (existingAccount)
|
116 |
+
existingAccount.observe('change', this.onAccountTypeChange.bind(this));
|
117 |
if (guestAccount)
|
118 |
+
guestAccount.observe('change', this.onAccountTypeChange.bind(this));
|
119 |
|
120 |
Validation.add('validate-fp-nickname', 'User with this nickname already exists', this.validateNickname.bind(this));
|
121 |
Validation.add('validate-fp-dob', 'There is no user with given nickname and date of birth', this.validateDob.bind(this));
|
122 |
|
123 |
+
if (nickname)
|
124 |
+
nickname.addClassName('validate-fp-nickname').observe('change', this.onNicknameChange.bind(this));
|
125 |
+
if (dob)
|
126 |
+
dob.addClassName('validate-fp-dob').observe('change', this.onDobChange.bind(this));
|
127 |
},
|
128 |
|
129 |
setUpHook: function () {
|
188 |
for (var i = 0; i < point.hours.length; i++) {
|
189 |
days.push('<span class="dow">' + point.hours[i].day + '</span>' + point.hours[i].hours.join(', '));
|
190 |
}
|
191 |
+
if (this.location)
|
192 |
+
point.distance = Math.abs(this.calcDistance(this.location.getPosition(), marker.getPosition()));
|
193 |
if (typeof this.infoCallback === 'function')
|
194 |
content = this.infoCallback(point);
|
195 |
else
|
207 |
},
|
208 |
|
209 |
calcDistance: function(p1, p2) {
|
210 |
+
return (google.maps.geometry.spherical.computeDistanceBetween(p1, p2) / 1000).toFixed(1);
|
211 |
},
|
212 |
|
213 |
addMarker: function (point) {
|
package.xml
CHANGED
@@ -1,18 +1,19 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>fermopoint</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Fermo!Points</summary>
|
10 |
<description>Module for integrating Fermo!Points collecting points system.</description>
|
11 |
-
<notes
|
|
|
12 |
<authors><author><name>Fermo!Point</name><user>fermopoint</user><email>support@fermopoint.it</email></author></authors>
|
13 |
-
<date>2015-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="FermoPoint"><dir name="StorePickup"><dir><dir name="Block"><dir name="Adminhtml"><dir name="Configuration"><file name="Disabled.php" hash="27fc2af187259bddd66552c84231f5f5"/><file name="Manual.php" hash="132e7c4a9f89ad71dccb4ce1b2c4c242"/></dir><dir name="Remote"><dir name="Grid"><dir name="Renderer"><file name="Notes.php" hash="0d3427070e683a438abdabc1926cf316"/></dir></dir><file name="Grid.php" hash="9dcea09a45c0dabe2931380a20a97b9b"/></dir><file name="Remote.php" hash="71367be2fb6723af4ff91b8207209ab0"/><file name="Stats.php" hash="e5f884c631ab63546570ab35e0a8336c"/></dir><dir name="Checkout"><dir name="Billing"><file name="Js.php" hash="6be3156e2bb484852a9d5b0e9aa7eee2"/><file name="Radio.php" hash="6839fed605f95a79537e09467a578e58"/></dir><dir name="Onepage"><dir name="Payment"><file name="Methods.php" hash="aa8e5a31eb2ce85672e0f8aa290b4759"/></dir><dir name="Shipping"><dir name="Method"><file name="Available.php" hash="59f7cea723940a81ab4a849b0dccca4f"/></dir></dir></dir></dir><dir name="FireCheckout"><dir name="Billing"><file name="Js.php" hash="dc5d3d07ad298c28a0651d6c090d7ef6"/><file name="Radio.php" hash="d85b3da0d7755b3e272a1102325815bf"/></dir><dir name="Onepage"><dir name="Payment"><file name="Methods.php" hash="aa8e5a31eb2ce85672e0f8aa290b4759"/></dir><dir name="Shipping"><dir name="Method"><file name="Available.php" hash="dc6592a6ed82b51a6eb8e44272a6248d"/></dir></dir></dir></dir><file name="Map.php" hash="4d6c24521489ea192bc1f0c0d3cbaf26"/></dir><dir name="Helper"><file name="Config.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>fermopoint</name>
|
4 |
+
<version>1.3.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Fermo!Points</summary>
|
10 |
<description>Module for integrating Fermo!Points collecting points system.</description>
|
11 |
+
<notes>+ Calculate cost based on subtotal or total weight
|
12 |
+
+ Guest-only Mode</notes>
|
13 |
<authors><author><name>Fermo!Point</name><user>fermopoint</user><email>support@fermopoint.it</email></author></authors>
|
14 |
+
<date>2015-12-22</date>
|
15 |
+
<time>10:48:46</time>
|
16 |
+
<contents><target name="magecommunity"><dir name="FermoPoint"><dir name="StorePickup"><dir><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Cost"><file name="Subtotal.php" hash="b3bf25953e7884456c37f73990cd27e8"/><file name="Weight.php" hash="b59ef2fdfdd1c3423dcda8cbafbf5c47"/></dir></dir><dir name="Configuration"><file name="Disabled.php" hash="27fc2af187259bddd66552c84231f5f5"/><file name="Manual.php" hash="132e7c4a9f89ad71dccb4ce1b2c4c242"/></dir><dir name="Remote"><dir name="Grid"><dir name="Renderer"><file name="Notes.php" hash="0d3427070e683a438abdabc1926cf316"/></dir></dir><file name="Grid.php" hash="9dcea09a45c0dabe2931380a20a97b9b"/></dir><file name="Remote.php" hash="71367be2fb6723af4ff91b8207209ab0"/><file name="Stats.php" hash="e5f884c631ab63546570ab35e0a8336c"/></dir><dir name="Checkout"><dir name="Billing"><file name="Js.php" hash="6be3156e2bb484852a9d5b0e9aa7eee2"/><file name="Radio.php" hash="6839fed605f95a79537e09467a578e58"/></dir><dir name="Onepage"><dir name="Payment"><file name="Methods.php" hash="aa8e5a31eb2ce85672e0f8aa290b4759"/></dir><dir name="Shipping"><dir name="Method"><file name="Available.php" hash="59f7cea723940a81ab4a849b0dccca4f"/></dir></dir></dir></dir><dir name="FireCheckout"><dir name="Billing"><file name="Js.php" hash="dc5d3d07ad298c28a0651d6c090d7ef6"/><file name="Radio.php" hash="d85b3da0d7755b3e272a1102325815bf"/></dir><dir name="Onepage"><dir name="Payment"><file name="Methods.php" hash="aa8e5a31eb2ce85672e0f8aa290b4759"/></dir><dir name="Shipping"><dir name="Method"><file name="Available.php" hash="dc6592a6ed82b51a6eb8e44272a6248d"/></dir></dir></dir></dir><file name="Map.php" hash="4d6c24521489ea192bc1f0c0d3cbaf26"/></dir><dir name="Helper"><file name="Config.php" hash="9c0f83eb482fb69375a184c11360dae6"/><file name="Data.php" hash="c96db1e5af0adb97798a01b8a5bf1721"/></dir><dir name="Model"><dir name="Api"><file name="OrderCollection.php" hash="f43b08d838be60a4e923fd8e3373356f"/><file name="SearchData.php" hash="ccbba430222bdfd145db0536914c7cc3"/></dir><file name="Api.php" hash="ea72b53b180c5d9a9e44f40bc413e881"/><dir name="Carrier"><file name="Storepickup.php" hash="e93431fe5eb8333f6531e94b43f51d2b"/></dir><file name="GoogleMaps.php" hash="57e207c865f97f5eb7c2832862a052d1"/><file name="Observer.php" hash="e115577112bed965e0bd1d23c9bbcdd3"/><dir name="Order"><file name="Point.php" hash="e5d033a2ee6add18f52bd0068102b22f"/></dir><file name="Point.php" hash="b5924ba282ad76dffc269b9c13b823f9"/><file name="Points.php" hash="37f236eabd20c5f91dc6958b600d5d21"/><dir name="Resource"><dir name="Order"><dir name="Point"><file name="Collection.php" hash="294427a66e6588ec4a5ef9af18eecd01"/></dir><file name="Point.php" hash="6c02668768be696fa833bab39fe3f9db"/></dir><dir name="Point"><file name="Collection.php" hash="9745e0182402f72ee43ce6cd7834afce"/></dir><file name="Point.php" hash="6b8e4a20dbda96bdf1c71bf56fcf8c31"/></dir><dir name="Source"><file name="Costmode.php" hash="2d1a5efc5339270fc9ba3e0acce47ef3"/><file name="Payment.php" hash="2a2213f3b7832f8891d147015c0361cd"/><file name="Selectorpayment.php" hash="8448ba93eb8ebe2c25eeeef100ff47f9"/><file name="State.php" hash="6a3f558509964600aa9491fbc7b5a15d"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="RemoteController.php" hash="1572704560ae35965d184bfa25fef23c"/></dir><file name="IndexController.php" hash="c35f79f12a2d78a38fd6b3cfa81f50ee"/><file name="ValidateController.php" hash="81869825387f94dfaa8475408edf054f"/></dir><dir name="etc"><file name="adminhtml.xml" hash="f790d0329024eba67a9018fd782a763a"/><file name="config.xml" hash="931a07a4982af796d3f5519793b87053"/><file name="jstranslator.xml" hash="f6340ca99cf070450e94d3f0c8f86da2"/><file name="system.xml" hash="0438f4b55be6633b39576704153b7bb3"/></dir><dir name="sql"><dir name="fpstorepickup_setup"><file name="mysql4-install-1.0.0.php" hash="c48472469c87f9975c4b203715e0137c"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="4801c11b1c8698ecbf9b4d857b055c33"/><file name="mysql4-upgrade-1.0.1-1.0.2.php" hash="21b100d87f0d3820e6317774c5ed273d"/><file name="mysql4-upgrade-1.1.1-1.1.2.php" hash="a120ae850a03a56010cf9576715beabd"/></dir></dir></dir><file name="Exception.php" hash="5d30b0aa037248c2709775c8485d5fff"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="fpstorepickup.xml" hash="e753271157b0dfbba46396a5046efdee"/></dir><dir name="template"><dir name="fpstorepickup"><file name="array.phtml" hash="76208141443ee6424b2a41aae63dcdf5"/><file name="stats.phtml" hash="977cf97e8e340abdc86825c4e853195c"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="fpstorepickup.xml" hash="ba7e537b0d17993a5cc7ab95765296ad"/></dir><dir name="template"><dir name="fpstorepickup"><dir><dir name="checkout"><dir name="onepage"><dir name="billing"><file name="js.phtml" hash="0d0d4fa1a2a807ececff43ffad03e322"/><file name="radio.phtml" hash="975e2309308ae63914aa16b9ad81ea47"/></dir></dir></dir><dir name="firecheckout"><dir name="onepage"><dir name="billing"><file name="js.phtml" hash="b5127c0c43885449bd5e65ffa54f0bc1"/><file name="radio.phtml" hash="a40fd64f5cdd9e35dcd4d8997cf22b13"/></dir></dir></dir></dir><file name="map.phtml" hash="5cfb0cbb2c3bc438b8148f7f6f89e463"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="FermoPoint_StorePickup.xml" hash="88569786925f04dade3952d7951f0fca"/></dir></dir></dir><dir name="js"><dir name="fermopoint"><file name="firecheckout.js" hash="c573c6f2f7a05998a9ed17c59bed749c"/><file name="markerclusterer.js" hash="b623ac6d39ea8ed99d179db49b7b0bab"/><file name="storepickup.js" hash="39eb87a1815ae491c3eb263b4fd69451"/></dir></dir><dir name="media"><dir name="fermopoint"><file name="cluster1.png" hash="545e7decba75c26883195707a1caf453"/><file name="cluster2.png" hash="1a2554261502135f8699081f7b7dfc15"/><file name="cluster3.png" hash="381dc5802ac150d868bab1edee7cba6c"/><file name="cluster4.png" hash="5fad1a5d344e178f587c759d9466a937"/><file name="marker_location.png" hash="000a6513abbe2c9683b19f49873710c5"/><file name="marker_point.png" hash="9b4dd5a4dd6ace99004ee529a9097de8"/></dir></dir></target><target name="magelocale"><dir name="it_IT"><file name="FermoPoint_StorePickup.csv" hash="cbaa015c86386833206af782606b37aa"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="fermopoint"><dir name="css"><file name="storepickup.css" hash="c7b2d42d974a3c19bc447925fc8222e0"/></dir><dir name="images"><file name="opc-ajax-loader.gif" hash="e805ea7eca1f34c75ba0f93780d32d38"/></dir></dir></dir></dir></dir></target></contents>
|
17 |
<compatible/>
|
18 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
19 |
</package>
|