Version Notes
* Performance improvements and fixes
Download this release
Release Info
Developer | Fermo!Point |
Extension | fermopoint |
Version | 1.3.2 |
Comparing to | |
See all releases |
Code changes from version 1.3.0 to 1.3.2
- app/code/community/FermoPoint/StorePickup/Helper/Firecheckout/Ajax.php +21 -0
- app/code/community/FermoPoint/StorePickup/Model/Carrier/Storepickup.php +2 -2
- app/code/community/FermoPoint/StorePickup/Model/Observer.php +11 -0
- app/code/community/FermoPoint/StorePickup/Model/Points.php +3 -3
- app/code/community/FermoPoint/StorePickup/etc/config.xml +14 -1
- package.xml +5 -6
app/code/community/FermoPoint/StorePickup/Helper/Firecheckout/Ajax.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FermoPoint_StorePickup_Helper_Firecheckout_Ajax extends TM_FireCheckout_Helper_Ajax {
|
4 |
+
|
5 |
+
public function getIsShippingMethodDependsOn($section)
|
6 |
+
{
|
7 |
+
$stack = debug_backtrace(true);
|
8 |
+
foreach ($stack as $line)
|
9 |
+
{
|
10 |
+
if ( ! isset($line['object']) || ! $line['object'] instanceof TM_FireCheckout_IndexController)
|
11 |
+
continue;
|
12 |
+
|
13 |
+
if ( ! isset($line['function']) || $line['function'] != 'saveShippingMethodAction')
|
14 |
+
continue;
|
15 |
+
|
16 |
+
return false;
|
17 |
+
}
|
18 |
+
return $this->getIsSectionDependsOn('shipping-method', $section);
|
19 |
+
}
|
20 |
+
|
21 |
+
}
|
app/code/community/FermoPoint/StorePickup/Model/Carrier/Storepickup.php
CHANGED
@@ -28,10 +28,10 @@ class FermoPoint_StorePickup_Model_Carrier_Storepickup
|
|
28 |
if ($request->getDestCountryId() !== 'IT')
|
29 |
return false;
|
30 |
|
31 |
-
if ($request->getPackageWeight() > $this->getConfigData('maximum_weight'))
|
32 |
return false;
|
33 |
|
34 |
-
if ($request->getBaseSubtotalInclTax() > $this->getConfigData('maximum_subtotal'))
|
35 |
return false;
|
36 |
|
37 |
$api = Mage::getSingleton('fpstorepickup/api');
|
28 |
if ($request->getDestCountryId() !== 'IT')
|
29 |
return false;
|
30 |
|
31 |
+
if ($this->getConfigData('maximum_weight') && ($request->getPackageWeight() > $this->getConfigData('maximum_weight')))
|
32 |
return false;
|
33 |
|
34 |
+
if ($this->getConfigData('maximum_subtotal') && ($request->getBaseSubtotalInclTax() > $this->getConfigData('maximum_subtotal')))
|
35 |
return false;
|
36 |
|
37 |
$api = Mage::getSingleton('fpstorepickup/api');
|
app/code/community/FermoPoint/StorePickup/Model/Observer.php
CHANGED
@@ -414,5 +414,16 @@ class FermoPoint_StorePickup_Model_Observer
|
|
414 |
$session->addError(Mage::helper('fpstorepickup')->__('Nickname and date of birth do not match!'));
|
415 |
$config->resetGuestEnabled();
|
416 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
417 |
|
418 |
}
|
414 |
$session->addError(Mage::helper('fpstorepickup')->__('Nickname and date of birth do not match!'));
|
415 |
$config->resetGuestEnabled();
|
416 |
}
|
417 |
+
|
418 |
+
public function fetchPoints()
|
419 |
+
{
|
420 |
+
$request = Mage::getModel('fpstorepickup/api_searchData');
|
421 |
+
$request->loadFromPost(array(
|
422 |
+
'latitude' => 41.9000,
|
423 |
+
'longitude' => 12.4833,
|
424 |
+
'radius' => 5000,
|
425 |
+
));
|
426 |
+
Mage::getSingleton('fpstorepickup/points')->getPoints($request, true);
|
427 |
+
}
|
428 |
|
429 |
}
|
app/code/community/FermoPoint/StorePickup/Model/Points.php
CHANGED
@@ -4,7 +4,7 @@ class FermoPoint_StorePickup_Model_Points {
|
|
4 |
|
5 |
const CACHE_TAG = 'fermopoint_points';
|
6 |
const CACHE_KEY = 'fermopoint_points_%s';
|
7 |
-
const CACHE_LIFETIME =
|
8 |
|
9 |
protected function _storePoint($data)
|
10 |
{
|
@@ -32,13 +32,13 @@ class FermoPoint_StorePickup_Model_Points {
|
|
32 |
return $point;
|
33 |
}
|
34 |
|
35 |
-
public function getPoints(FermoPoint_StorePickup_Model_Api_SearchData $request)
|
36 |
{
|
37 |
$needles = $request->toApi();
|
38 |
$cacheKey = sprintf(self::CACHE_KEY, sha1(implode(',', $needles)));
|
39 |
$cache = Mage::app()->getCache();
|
40 |
$value = unserialize($cache->load($cacheKey));
|
41 |
-
if ( ! is_array($value) || ! $request->compare($value))
|
42 |
{
|
43 |
$points = Mage::getSingleton('fpstorepickup/api')->getPoints($needles);
|
44 |
$value = $needles;
|
4 |
|
5 |
const CACHE_TAG = 'fermopoint_points';
|
6 |
const CACHE_KEY = 'fermopoint_points_%s';
|
7 |
+
const CACHE_LIFETIME = 3900; // 1 hour + 5 minutes to overlap cronjob
|
8 |
|
9 |
protected function _storePoint($data)
|
10 |
{
|
32 |
return $point;
|
33 |
}
|
34 |
|
35 |
+
public function getPoints(FermoPoint_StorePickup_Model_Api_SearchData $request, $bypassCache = false)
|
36 |
{
|
37 |
$needles = $request->toApi();
|
38 |
$cacheKey = sprintf(self::CACHE_KEY, sha1(implode(',', $needles)));
|
39 |
$cache = Mage::app()->getCache();
|
40 |
$value = unserialize($cache->load($cacheKey));
|
41 |
+
if ($bypassCache || ! is_array($value) || ! $request->compare($value))
|
42 |
{
|
43 |
$points = Mage::getSingleton('fpstorepickup/api')->getPoints($needles);
|
44 |
$value = $needles;
|
app/code/community/FermoPoint/StorePickup/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<FermoPoint_StorePickup>
|
5 |
-
<version>1.3.
|
6 |
</FermoPoint_StorePickup>
|
7 |
</modules>
|
8 |
<global>
|
@@ -38,6 +38,11 @@
|
|
38 |
<fpstorepickup>
|
39 |
<class>FermoPoint_StorePickup_Helper</class>
|
40 |
</fpstorepickup>
|
|
|
|
|
|
|
|
|
|
|
41 |
</helpers>
|
42 |
<resources>
|
43 |
<fpstorepickup_setup>
|
@@ -224,6 +229,14 @@
|
|
224 |
</admin_system_config_section_save_after>
|
225 |
</events>
|
226 |
</adminhtml>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
<default>
|
228 |
<carriers>
|
229 |
<fpstorepickup>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<FermoPoint_StorePickup>
|
5 |
+
<version>1.3.2</version>
|
6 |
</FermoPoint_StorePickup>
|
7 |
</modules>
|
8 |
<global>
|
38 |
<fpstorepickup>
|
39 |
<class>FermoPoint_StorePickup_Helper</class>
|
40 |
</fpstorepickup>
|
41 |
+
<firecheckout>
|
42 |
+
<rewrite>
|
43 |
+
<ajax>FermoPoint_StorePickup_Helper_Firecheckout_Ajax</ajax>
|
44 |
+
</rewrite>
|
45 |
+
</firecheckout>
|
46 |
</helpers>
|
47 |
<resources>
|
48 |
<fpstorepickup_setup>
|
229 |
</admin_system_config_section_save_after>
|
230 |
</events>
|
231 |
</adminhtml>
|
232 |
+
<crontab>
|
233 |
+
<jobs>
|
234 |
+
<prefetch_fp_points>
|
235 |
+
<schedule><cron_expr>0 * * * *</cron_expr></schedule>
|
236 |
+
<run><model>fpstorepickup/observer::fetchPoints</model></run>
|
237 |
+
</prefetch_fp_points>
|
238 |
+
</jobs>
|
239 |
+
</crontab>
|
240 |
<default>
|
241 |
<carriers>
|
242 |
<fpstorepickup>
|
package.xml
CHANGED
@@ -1,19 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>fermopoint</name>
|
4 |
-
<version>1.3.
|
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 |
-
+ Guest-only Mode</notes>
|
13 |
<authors><author><name>Fermo!Point</name><user>fermopoint</user><email>support@fermopoint.it</email></author></authors>
|
14 |
-
<date>
|
15 |
-
<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="
|
17 |
<compatible/>
|
18 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
19 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>fermopoint</name>
|
4 |
+
<version>1.3.2</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>* Performance improvements and fixes</notes>
|
|
|
12 |
<authors><author><name>Fermo!Point</name><user>fermopoint</user><email>support@fermopoint.it</email></author></authors>
|
13 |
+
<date>2016-01-21</date>
|
14 |
+
<time>07:11:38</time>
|
15 |
+
<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 name="Firecheckout"><file name="Ajax.php" hash="3378c6cfd23447b88c10d9d2f1f3bf77"/></dir></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="dfe2df3144df320cc38dd0a69aa7e113"/></dir><file name="GoogleMaps.php" hash="57e207c865f97f5eb7c2832862a052d1"/><file name="Observer.php" hash="c2f888154071aefbe61594abdc07da74"/><dir name="Order"><file name="Point.php" hash="e5d033a2ee6add18f52bd0068102b22f"/></dir><file name="Point.php" hash="b5924ba282ad76dffc269b9c13b823f9"/><file name="Points.php" hash="74965213fce4342cae2fb1dc243fda36"/><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="ac92747eac5c2424c20ba47583ed1b7a"/><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>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|