OmxConnector - Version 1.2.0

Version Notes

Download and install this Module and follow the instructions in the Admin Notifications.

If you have a OrderMotion OMX account you may also dowload the full version directly from your OMX account.

Download this release

Release Info

Developer Magento Core Team
Extension OmxConnector
Version 1.2.0
Comparing to
See all releases


Version 1.2.0

app/code/local/Omx/Start/Helper/Data.php ADDED
@@ -0,0 +1,4 @@
1
+ <?php
2
+ class Omx_Start_Helper_Data extends Mage_Core_Helper_Abstract {
3
+
4
+ }
app/code/local/Omx/Start/Model/AdminNotification.php ADDED
@@ -0,0 +1,16 @@
1
+ <?php
2
+ class Omx_Start_Model_AdminNotification extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('adminnotification/inbox', 'notification_id');
7
+ }
8
+
9
+ public function create(array $data)
10
+ {
11
+ $write = $this->_getWriteAdapter();
12
+ foreach ($data as $item) {
13
+ $write->insert($this->getMainTable(), $item);
14
+ }
15
+ }
16
+ }
app/code/local/Omx/Start/Model/Observer.php ADDED
@@ -0,0 +1,42 @@
1
+ <?php
2
+ class Omx_Start_Model_Observer
3
+ {
4
+ public function startAdminhtmlBlockHtmlBefore(Varien_Event_Observer $observer){
5
+ $version = Mage::getVersionInfo();
6
+ $olderVersion = ($version['major'] == 1 && $version['minor']<=8) ? true : false;
7
+
8
+ if (!Mage::helper('core/data')->isModuleOutputEnabled('Omx_Hooks') || $olderVersion) {
9
+ // looking for exiting messages
10
+ $title = 'Getting started with Magento OMX Connector';
11
+ $description = '<p>To get started with Magnto OMX Connector go to your <a href="http://omx.ordermotion.com" target="_blank">OMX account</a> download the full version of this connector and install it!</p>
12
+ <p><b>After the installation the full Extension uninstall this this one. (Omx/Start) !</b></p>
13
+ <p> If you have any qestions please contact us under <a href="http://info.ordermotion.com/contact-us" target="_blank">http://info.ordermotion.com/contact-us</a></p>';
14
+ $prevMessages = Mage::getModel('adminnotification/inbox')
15
+ ->getCollection()
16
+ ->addFilter('title', $title)
17
+ ->addFilter('is_remove', 0)
18
+ -> load();
19
+ // If there are no previous messages sent today, proceed sending an admin notification
20
+ if(!$prevMessages->count()) {
21
+ $now = Zend_Date::now();
22
+ $now->setTimezone('America/New_York');
23
+ $timestring = $now->toString("yyyy-MM-dd")." 00:00:00";
24
+
25
+ $newMessage = Mage::getModel('start/adminNotification');
26
+ $newMessage->create(
27
+ array(
28
+ array(
29
+ 'severity' => Mage_AdminNotification_Model_Inbox::SEVERITY_NOTICE,
30
+ 'date_added' => $now->toString("yyyy-MM-dd HH:mm:ss"),
31
+ 'title' => $title,
32
+ 'description' => $description,
33
+ 'url' => 'https://omx.ordermotion.com/en/console.asp'
34
+ )
35
+ )
36
+ );
37
+ }
38
+ }
39
+
40
+ }
41
+
42
+ }
app/code/local/Omx/Start/etc/config.xml ADDED
@@ -0,0 +1,31 @@
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Omx_Start>
5
+ <version>1.0.0</version>
6
+ </Omx_Start>
7
+ </modules>
8
+ <global>
9
+ <helpers>
10
+ <hooks>
11
+ <class>Omx_Start_Helper</class>
12
+ </hooks>
13
+ </helpers>
14
+ <models><!-- definition of the models should be here -->
15
+ <start>
16
+ <class>Omx_Start_Model</class>
17
+ </start>
18
+ </models>
19
+ <events><!-- register observer for these events -->
20
+ <adminhtml_block_html_before>
21
+ <observers>
22
+ <start_message>
23
+ <type>singleton</type>
24
+ <class>start/observer</class>
25
+ <method>startAdminhtmlBlockHtmlBefore</method>
26
+ </start_message>
27
+ </observers>
28
+ </adminhtml_block_html_before>
29
+ </events>
30
+ </global>
31
+ </config>
app/etc/modules/Omx_Start.xml ADDED
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <Omx_Start>
5
+ <codePool>local</codePool>
6
+ <active>true</active>
7
+ </Omx_Start>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>OmxConnector</name>
4
+ <version>1.2.0</version>
5
+ <stability>stable</stability>
6
+ <license>MIT</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Synchronizes an Magento Store with an OrderMotion OMX account.</summary>
10
+ <description>Synchronizes an Magento Store with an OrderMotion OMX account.</description>
11
+ <notes>Download and install this Module and follow the instructions in the Admin Notifications.&#xD;
12
+ &#xD;
13
+ If you have a OrderMotion OMX account you may also dowload the full version directly from your OMX account.</notes>
14
+ <authors><author><name>OrderMotion</name><user>auto-converted</user><email>jane@ordermotion.com</email></author></authors>
15
+ <date>2011-10-10</date>
16
+ <time>13:22:26</time>
17
+ <contents><target name="magelocal"><dir name="Omx"><dir name="Start"><dir name="etc"><file name="config.xml" hash="34dad88c79e8fa48cb199409d4853187"/></dir><dir name="Helper"><file name="Data.php" hash="4d1273ee1c8b2a0abbe5614bb20e9de2"/></dir><dir name="Model"><file name="AdminNotification.php" hash="795ce7a34b216cb4e985ec8b0f3e5f96"/><file name="Observer.php" hash="05ac3323e52a9dc17dcb164ef102304a"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Omx_Start.xml" hash="3ee955882da1bf32c6b35bc74dcfd526"/></dir></target></contents>
18
+ <compatible/>
19
+ <dependencies/>
20
+ </package>