NewsModules_FixCatalogRule - Version 0.1.0

Version Notes

Fix catalog price rules disappear overnight.

Download this release

Release Info

Developer Alessandro Lioce
Extension NewsModules_FixCatalogRule
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

app/code/community/NewsModules/FixCatalogRule/Model/Observer.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class NewsModules_FixCatalogRule_Model_Observer extends Mage_CatalogRule_Model_Observer
3
+ {
4
+ /**
5
+ * Daily update catalog price rule by cron
6
+ * Update include interval 3 days - current day - 1 days before + 1 days after
7
+ * This method is called from cron process, cron is working in UTC time and
8
+ * we should generate data for interval -1 day ... +1 day
9
+ *
10
+ * @param Varien_Event_Observer $observer
11
+ *
12
+ * @return Mage_CatalogRule_Model_Observer
13
+ */
14
+ public function dailyCatalogUpdate($observer)
15
+ {
16
+ /** @var $resource Mage_CatalogRule_Model_Resource_Rule */
17
+ /*
18
+ $resource = Mage::getResourceSingleton('catalogrule/rule');
19
+ $resource->applyAllRules();
20
+ */
21
+
22
+ Mage::getModel('catalogrule/rule')->applyAll();
23
+ Mage::getModel('catalogrule/flag')->loadSelf()
24
+ ->setState(0)
25
+ ->save();
26
+
27
+ return $this;
28
+ }
29
+ }
app/code/community/NewsModules/FixCatalogRule/etc/config.xml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <NewsModules_FixCatalogRule>
5
+ <version>0.1.0</version>
6
+ </NewsModules_FixCatalogRule>
7
+ </modules>
8
+ <global>
9
+ <models>
10
+ <catalogrule>
11
+ <rewrite>
12
+ <observer>NewsModules_FixCatalogRule_Model_Observer</observer>
13
+ </rewrite>
14
+ </catalogrule>
15
+ </models>
16
+ </global>
17
+ </config>
app/etc/modules/NewsModules_FixCatalogRule.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <NewsModules_FixCatalogRule>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <depends>
8
+ <Mage_CatalogRule/>
9
+ </depends>
10
+ </NewsModules_FixCatalogRule>
11
+ </modules>
12
+ </config>
package.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>NewsModules_FixCatalogRule</name>
4
+ <version>0.1.0</version>
5
+ <stability>stable</stability>
6
+ <license>GNU General Public License (GPL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Fix catalog price rules disappear overnight.</summary>
10
+ <description>Fix catalog price rules disappear overnight.&#xD;
11
+ &#xD;
12
+ The specified versions are tested versions. The module may also work on other versions.</description>
13
+ <notes>Fix catalog price rules disappear overnight.</notes>
14
+ <authors><author><name>Alessandro Lioce</name><user>alioce</user><email>a.lioce@ne-ws.it</email></author></authors>
15
+ <date>2014-06-11</date>
16
+ <time>13:23:05</time>
17
+ <contents><target name="magecommunity"><dir name="NewsModules"><dir name="FixCatalogRule"><dir name="Model"><file name="Observer.php" hash="198dc76fded9e4dceeed4134391b82d7"/></dir><dir name="etc"><file name="config.xml" hash="a08e5e83696f41831178692092761767"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="NewsModules_FixCatalogRule.xml" hash="a2459f0919a34a1de8860f1ca56b27fa"/></dir></target></contents>
18
+ <compatible/>
19
+ <dependencies><required><php><min>5.2.13</min><max>5.4.29</max></php></required></dependencies>
20
+ </package>