Camiloo_Channelunity - Version 1.0.0.2

Version Notes

The ChannelUnity connector kit for Magento.
This version checks for orders imported by the Amazon module so as not to import 2 copies of the same order when moving over to ChannelUnity.

Download this release

Release Info

Developer Magento Core Team
Extension Camiloo_Channelunity
Version 1.0.0.2
Comparing to
See all releases


Code changes from version 1.0.0.1 to 1.0.0.2

app/code/community/Camiloo/Channelunity/Model/Orders.php CHANGED
@@ -677,6 +677,23 @@ class Camiloo_Channelunity_Model_Orders extends Camiloo_Channelunity_Model_Abstr
677
  }
678
  }
679
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
680
  if (!$bOrderExisted) {
681
  if (((string) $order->OrderStatus) == "Processing") {
682
  // if the stock isn't already decreased, decrease it
@@ -711,6 +728,13 @@ class Camiloo_Channelunity_Model_Orders extends Camiloo_Channelunity_Model_Abstr
711
  }
712
  }
713
  }
 
 
 
 
 
 
 
714
  }
715
 
716
  ?>
677
  }
678
  }
679
 
680
+ $table_prefix = Mage::getConfig()->getTablePrefix();
681
+
682
+ // See if the order has been imported by the old Amazon module
683
+ if (!$bOrderExisted && $this->table_exists("{$table_prefix}amazonimport_flatorders")) {
684
+ $oid = (string) $order->OrderId;
685
+ $db = Mage::getSingleton("core/resource")->getConnection("core_write");
686
+
687
+ $_sql = "SELECT * FROM {$table_prefix}amazonimport_flatorders WHERE amazon_order_id='$oid'";
688
+
689
+ $result = $db->query($_sql);
690
+
691
+ if ($result->rowCount() > 0) {
692
+ $bOrderExisted = true;
693
+ }
694
+ }
695
+
696
+ //=======================================================
697
  if (!$bOrderExisted) {
698
  if (((string) $order->OrderStatus) == "Processing") {
699
  // if the stock isn't already decreased, decrease it
728
  }
729
  }
730
  }
731
+
732
+ public function table_exists($tablename) {
733
+ $db = Mage::getSingleton("core/resource")->getConnection("core_write");
734
+ $_sql = "SHOW TABLES LIKE '$tablename';";
735
+ $result = $db->query($_sql);
736
+ return $result->rowCount() > 0;
737
+ }
738
  }
739
 
740
  ?>
app/code/community/Camiloo/Channelunity/Model/Stores.php CHANGED
@@ -29,7 +29,6 @@ class Camiloo_Channelunity_Model_Stores extends Camiloo_Channelunity_Model_Abstr
29
 
30
  foreach ($stores as $store) {
31
 
32
-
33
  $storeViews = Mage::getModel('core/store')
34
  ->getCollection()->addFieldToFilter('website_id', array('eq' => $website->getData('website_id')))
35
  ->addFieldToFilter('group_id', array('eq' => $store->getData('group_id')));
@@ -37,7 +36,7 @@ class Camiloo_Channelunity_Model_Stores extends Camiloo_Channelunity_Model_Abstr
37
  foreach ($storeViews as $storeView) {
38
 
39
  $messageToSend = "<Store>
40
- <FriendlyName><![CDATA[{$storeView->getData('name')}]]></FriendlyName>
41
  <URL><![CDATA[{$myURL}]]></URL>
42
  <MainCountry><![CDATA[Unknown]]></MainCountry>
43
  <FrameworkType><![CDATA[Magento]]></FrameworkType>
29
 
30
  foreach ($stores as $store) {
31
 
 
32
  $storeViews = Mage::getModel('core/store')
33
  ->getCollection()->addFieldToFilter('website_id', array('eq' => $website->getData('website_id')))
34
  ->addFieldToFilter('group_id', array('eq' => $store->getData('group_id')));
36
  foreach ($storeViews as $storeView) {
37
 
38
  $messageToSend = "<Store>
39
+ <FriendlyName><![CDATA[{$storeView->getData('name')} - {$storeView->getData('code')}]]></FriendlyName>
40
  <URL><![CDATA[{$myURL}]]></URL>
41
  <MainCountry><![CDATA[Unknown]]></MainCountry>
42
  <FrameworkType><![CDATA[Magento]]></FrameworkType>
app/code/community/Camiloo/Channelunity/controllers/ApiController.php CHANGED
@@ -10,7 +10,13 @@ class Camiloo_Channelunity_ApiController extends Mage_Core_Controller_Front_Acti
10
  echo ' </ChannelUnity>';
11
  die;
12
  }
13
-
 
 
 
 
 
 
14
  public function ordertestAction() {
15
 
16
  $xml = <<<EOD
10
  echo ' </ChannelUnity>';
11
  die;
12
  }
13
+ public function testtableAction() {
14
+ if (Mage::getModel('channelunity/orders')->table_exists("moo")) {
15
+ echo "true";
16
+ } else {
17
+ echo "false";
18
+ }
19
+ }
20
  public function ordertestAction() {
21
 
22
  $xml = <<<EOD
app/code/community/Camiloo/Channelunity/sql/channelunity_setup/install-1.0.0.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  $installer = $this;
4
  $installer->startSetup();
5
-
6
  $installer->addAttribute('quote_payment', 'channelunity_orderid', array());
7
  $installer->addAttribute('quote_payment', 'channelunity_remoteorderid', array());
8
  $installer->addAttribute('quote_payment', 'channelunity_remotechannelname', array());
@@ -12,7 +12,7 @@ $installer->addAttribute('order_payment', 'channelunity_orderid', array());
12
  $installer->addAttribute('order_payment', 'channelunity_remoteorderid', array());
13
  $installer->addAttribute('order_payment', 'channelunity_remotechannelname', array());
14
  $installer->addAttribute('order_payment', 'channelunity_subscriptionid', array());
15
-
16
  $installer->endSetup();
17
 
18
  $adminSession = Mage::getSingleton('admin/session');
2
 
3
  $installer = $this;
4
  $installer->startSetup();
5
+ /*
6
  $installer->addAttribute('quote_payment', 'channelunity_orderid', array());
7
  $installer->addAttribute('quote_payment', 'channelunity_remoteorderid', array());
8
  $installer->addAttribute('quote_payment', 'channelunity_remotechannelname', array());
12
  $installer->addAttribute('order_payment', 'channelunity_remoteorderid', array());
13
  $installer->addAttribute('order_payment', 'channelunity_remotechannelname', array());
14
  $installer->addAttribute('order_payment', 'channelunity_subscriptionid', array());
15
+ */
16
  $installer->endSetup();
17
 
18
  $adminSession = Mage::getSingleton('admin/session');
app/code/community/Camiloo/Channelunity/sql/channelunity_setup/mysql4-install-0.0.1.php CHANGED
@@ -3,15 +3,6 @@
3
  $installer = $this;
4
  $installer->startSetup();
5
 
6
- $installer->addAttribute('quote_payment', 'channelunity_orderid', array());
7
- $installer->addAttribute('quote_payment', 'channelunity_remoteorderid', array());
8
- $installer->addAttribute('quote_payment', 'channelunity_remotechannelname', array());
9
- $installer->addAttribute('quote_payment', 'channelunity_subscriptionid', array());
10
-
11
- $installer->addAttribute('order_payment', 'channelunity_orderid', array());
12
- $installer->addAttribute('order_payment', 'channelunity_remoteorderid', array());
13
- $installer->addAttribute('order_payment', 'channelunity_remotechannelname', array());
14
- $installer->addAttribute('order_payment', 'channelunity_subscriptionid', array());
15
 
16
  $installer->endSetup();
17
 
3
  $installer = $this;
4
  $installer->startSetup();
5
 
 
 
 
 
 
 
 
 
 
6
 
7
  $installer->endSetup();
8
 
app/design/adminhtml/default/default/template/channelunity/configheader.phtml CHANGED
@@ -16,7 +16,7 @@
16
  <h3>ChannelUnity Integration for Magento</h3>
17
  Devised and Developed in Manchester, UK by <a href="http://www.camiloo.co.uk/?ref=cu" target="_blank">Camiloo Limited</a><br />
18
  <?php
19
- $xml = Mage::getModel('channelunity/checkforupdates')->getRemoteXMLFileData("http://my.channelunity.com/versioncheck.php?Version=1.00");
20
  $html = $xml->DisplayMessage[0];
21
  echo $html;
22
  ?>
16
  <h3>ChannelUnity Integration for Magento</h3>
17
  Devised and Developed in Manchester, UK by <a href="http://www.camiloo.co.uk/?ref=cu" target="_blank">Camiloo Limited</a><br />
18
  <?php
19
+ $xml = Mage::getModel('channelunity/checkforupdates')->getRemoteXMLFileData("http://my.channelunity.com/versioncheck.php?Version=1.0.0.2");
20
  $html = $xml->DisplayMessage[0];
21
  echo $html;
22
  ?>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Camiloo_Channelunity</name>
4
- <version>1.0.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.camiloo.co.uk/license.txt">Camiloo EULA</license>
7
  <channel>community</channel>
@@ -10,11 +10,12 @@
10
  <description>This module allows Magento to connect to your account on channelunity.com
11
 
12
  Should you need any help getting started, please email support@camiloo.co.uk</description>
13
- <notes>The ChannelUnity connector kit for Magento.</notes>
 
14
  <authors><author><name>Camiloo Limited</name><user>auto-converted</user><email>hello@camiloo.co.uk</email></author></authors>
15
- <date>2012-04-20</date>
16
- <time>14:59:17</time>
17
- <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="channelunity"><file name="configheader.phtml" hash="5d21d8ef92b2dc28e952eeddf9a391fa"/><file name="paymentinfo.phtml" hash="60967f7ab38fe17c879b272eed25f986"/></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Camiloo"><dir name="Channelunity"><dir name="Block"><file name="Configheader.php" hash="6d7de078f04901e94b8b9675bcd9e4ac"/><file name="Paymentform.php" hash="1f3e79556f15a57b9761c3665a103103"/><file name="Paymentinfo.php" hash="6c3c36d92592dd802fb8045dc065d231"/></dir><dir name="controllers"><file name="ApiController.php" hash="f21ce3f7c5ef302579219eaef57f6ee9"/><file name="ApiController.php.old.php" hash="01ff34c2cf5798a82cfc11b19ab6decd"/></dir><dir name="etc"><file name="config.xml" hash="94c1ec56968437ee64488eabc4451b0f"/><file name="system.xml" hash="b43f861f8ab3dadca3c122be10790609"/></dir><dir name="Helper"><file name="Data.php" hash="1ccace887d4a09eca0b641394c65d35f"/></dir><dir name="Model"><file name="Abstract.php" hash="dde32099ae2fc34f9cd7e9c2ae23bc3c"/><file name="Attributes.php" hash="b6428ef515e083e172ccf0b6e07e32fe"/><file name="Categories.php" hash="0d741f1a1384bca8b26b933e5fa23157"/><file name="Checkforupdates.php" hash="6fcf97b37aa3f3a1e0149f7761975925"/><file name="Customrate.php" hash="5dab412e72c869599c8cfb670519da65"/><file name="Entity.php" hash="8ff876068c52106c589a5079cc0f9215"/><file name="Observer.php" hash="66bfe119a54fad8c2a80f7fa6e33c238"/><file name="Ordercreatebackport.php" hash="3b696fb97ce6550a967d76436a3d131c"/><file name="Orders.php" hash="fe348754144f623bd61b40a4b4bbc127"/><file name="Payment.php" hash="7fe570cf0aaf7c2bcdf1982b6e69caa6"/><file name="Paymentinfo.php" hash="e11658c9fa02420557441f5c8a41f8a0"/><file name="Paymentmethoduk.php" hash="a99409ed4ee5f7e426df4eaf793482d6"/><file name="Products.php" hash="6ee2b3ad8383e4f560eefa66bdeea2c9"/><file name="Stores.php" hash="a8dad8786c9f188d2435d6c5b8222cad"/></dir><dir name="sql"><dir name="channelunity_setup"><file name="install-1.0.0.php" hash="362396ea358cbfd7d64ce07c4d4fab1a"/><file name="mysql4-install-0.0.1.php" hash="f8c841babd0c387f710c3404b70de08f"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Camiloo_Channelunity.xml" hash="cccfbce64ee176372c5afecb8676fab0"/></dir></target></contents>
18
  <compatible/>
19
  <dependencies/>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Camiloo_Channelunity</name>
4
+ <version>1.0.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.camiloo.co.uk/license.txt">Camiloo EULA</license>
7
  <channel>community</channel>
10
  <description>This module allows Magento to connect to your account on channelunity.com
11
 
12
  Should you need any help getting started, please email support@camiloo.co.uk</description>
13
+ <notes>The ChannelUnity connector kit for Magento.
14
+ This version checks for orders imported by the Amazon module so as not to import 2 copies of the same order when moving over to ChannelUnity.</notes>
15
  <authors><author><name>Camiloo Limited</name><user>auto-converted</user><email>hello@camiloo.co.uk</email></author></authors>
16
+ <date>2012-05-01</date>
17
+ <time>09:26:10</time>
18
+ <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="channelunity"><file name="configheader.phtml" hash="7518354940f62a011a895d371d2e7c4c"/><file name="paymentinfo.phtml" hash="60967f7ab38fe17c879b272eed25f986"/></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Camiloo"><dir name="Channelunity"><dir name="Block"><file name="Configheader.php" hash="6d7de078f04901e94b8b9675bcd9e4ac"/><file name="Paymentform.php" hash="1f3e79556f15a57b9761c3665a103103"/><file name="Paymentinfo.php" hash="6c3c36d92592dd802fb8045dc065d231"/></dir><dir name="controllers"><file name="ApiController.php" hash="0c8654c03d157db4fb70dd163f5da654"/><file name="ApiController.php.old.php" hash="01ff34c2cf5798a82cfc11b19ab6decd"/></dir><dir name="etc"><file name="config.xml" hash="94c1ec56968437ee64488eabc4451b0f"/><file name="system.xml" hash="b43f861f8ab3dadca3c122be10790609"/></dir><dir name="Helper"><file name="Data.php" hash="1ccace887d4a09eca0b641394c65d35f"/></dir><dir name="Model"><file name="Abstract.php" hash="dde32099ae2fc34f9cd7e9c2ae23bc3c"/><file name="Attributes.php" hash="b6428ef515e083e172ccf0b6e07e32fe"/><file name="Categories.php" hash="0d741f1a1384bca8b26b933e5fa23157"/><file name="Checkforupdates.php" hash="6fcf97b37aa3f3a1e0149f7761975925"/><file name="Customrate.php" hash="5dab412e72c869599c8cfb670519da65"/><file name="Entity.php" hash="8ff876068c52106c589a5079cc0f9215"/><file name="Observer.php" hash="66bfe119a54fad8c2a80f7fa6e33c238"/><file name="Ordercreatebackport.php" hash="3b696fb97ce6550a967d76436a3d131c"/><file name="Orders.php" hash="cfa2856e253b0fddef6b53bfd50e95d4"/><file name="Payment.php" hash="7fe570cf0aaf7c2bcdf1982b6e69caa6"/><file name="Paymentinfo.php" hash="e11658c9fa02420557441f5c8a41f8a0"/><file name="Paymentmethoduk.php" hash="a99409ed4ee5f7e426df4eaf793482d6"/><file name="Products.php" hash="6ee2b3ad8383e4f560eefa66bdeea2c9"/><file name="Stores.php" hash="7f299877f0b62ca9d30a46b333124680"/></dir><dir name="sql"><dir name="channelunity_setup"><file name="install-1.0.0.php" hash="7127fff7219108813aa35dd7596b09d3"/><file name="mysql4-install-0.0.1.php" hash="7ebc892c87b9401bf402a7e1976133e3"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Camiloo_Channelunity.xml" hash="cccfbce64ee176372c5afecb8676fab0"/></dir></target></contents>
19
  <compatible/>
20
  <dependencies/>
21
  </package>