Auctane_ShipStation - Version 1.3.3

Version Notes

Official release.
Include debugging information and limit page size to 100 orders when exporting.

Download this release

Release Info

Developer Clockworkgeek
Extension Auctane_ShipStation
Version 1.3.3
Comparing to
See all releases


Code changes from version 1.3.0 to 1.3.3

app/code/community/Auctane/Api/Model/Server/Adapter.php CHANGED
@@ -66,6 +66,17 @@ class Auctane_Api_Model_Server_Adapter
66
  return $this->getData('controller');
67
  }
68
 
 
 
 
 
 
 
 
 
 
 
 
69
  /**
70
  * Run webservice
71
  *
@@ -96,6 +107,8 @@ class Auctane_Api_Model_Server_Adapter
96
  $end_date = strtotime($this->getController()->getRequest()->getParam('end_date'));
97
  if (!$start_date || !$end_date) throw new Exception('Start and end dates are required', 400);
98
 
 
 
99
  /* @var $orders Mage_Sales_Model_Mysql4_Order_Collection */
100
  $orders = Mage::getResourceModel('sales/order_collection');
101
  // might use 'created_at' attribute instead
@@ -105,6 +118,7 @@ class Auctane_Api_Model_Server_Adapter
105
  'to' => date('Y-m-d H:i:s', $end_date)
106
  ));
107
  if ($store) $orders->addAttributeToFilter('store_id', $store->getId());
 
108
 
109
  $xml = new XMLWriter;
110
  $xml->openMemory();
@@ -187,9 +201,13 @@ class Auctane_Api_Model_Server_Adapter
187
  protected function _writeOrders(Varien_Data_Collection $orders, XMLWriter $xml, $storeId = null)
188
  {
189
  $xml->startElement('Orders');
 
190
  foreach ($orders as $order) {
191
  $this->_writeOrder($order, $xml, $storeId);
192
  }
 
 
 
193
  $xml->endElement(); // Orders
194
  }
195
 
66
  return $this->getData('controller');
67
  }
68
 
69
+ protected function _getExportPageSize()
70
+ {
71
+ return (int) Mage::getStoreConfig('auctaneapi/config/exportPageSize');
72
+ }
73
+
74
+ protected function _getModuleList()
75
+ {
76
+ $modules = array_keys((array)Mage::getConfig()->getNode('modules')->children());
77
+ return implode(',', $modules);
78
+ }
79
+
80
  /**
81
  * Run webservice
82
  *
107
  $end_date = strtotime($this->getController()->getRequest()->getParam('end_date'));
108
  if (!$start_date || !$end_date) throw new Exception('Start and end dates are required', 400);
109
 
110
+ $page = (int) $this->getController()->getRequest()->getParam('page');
111
+
112
  /* @var $orders Mage_Sales_Model_Mysql4_Order_Collection */
113
  $orders = Mage::getResourceModel('sales/order_collection');
114
  // might use 'created_at' attribute instead
118
  'to' => date('Y-m-d H:i:s', $end_date)
119
  ));
120
  if ($store) $orders->addAttributeToFilter('store_id', $store->getId());
121
+ if ($page > 0) $orders->setPage($page, $this->_getExportPageSize());
122
 
123
  $xml = new XMLWriter;
124
  $xml->openMemory();
201
  protected function _writeOrders(Varien_Data_Collection $orders, XMLWriter $xml, $storeId = null)
202
  {
203
  $xml->startElement('Orders');
204
+ $xml->writeAttribute('pages', $orders->getLastPageNumber());
205
  foreach ($orders as $order) {
206
  $this->_writeOrder($order, $xml, $storeId);
207
  }
208
+ $xml->writeElement('Query', $orders->getSelectSql());
209
+ $xml->writeElement('Version', 'Magento ' . Mage::getVersion());
210
+ $xml->writeElement('Extensions', $this->_getModuleList());
211
  $xml->endElement(); // Orders
212
  }
213
 
app/code/community/Auctane/Api/etc/config.xml CHANGED
@@ -19,7 +19,7 @@
19
  <config>
20
  <modules>
21
  <Auctane_Api>
22
- <version>0.2.0</version>
23
  </Auctane_Api>
24
  </modules>
25
 
@@ -153,6 +153,7 @@
153
  <auctaneapi>
154
  <config>
155
  <realm>Auctane ShipStation</realm>
 
156
  </config>
157
  </auctaneapi>
158
  </default>
19
  <config>
20
  <modules>
21
  <Auctane_Api>
22
+ <version>0.3.0</version>
23
  </Auctane_Api>
24
  </modules>
25
 
153
  <auctaneapi>
154
  <config>
155
  <realm>Auctane ShipStation</realm>
156
+ <exportPageSize>100</exportPageSize>
157
  </config>
158
  </auctaneapi>
159
  </default>
app/code/community/Auctane/ShipStation/etc/config.xml CHANGED
@@ -19,7 +19,7 @@
19
  <config>
20
  <modules>
21
  <Auctane_ShipStation>
22
- <version>1.3.0</version>
23
  </Auctane_ShipStation>
24
  </modules>
25
 
19
  <config>
20
  <modules>
21
  <Auctane_ShipStation>
22
+ <version>1.3.3</version>
23
  </Auctane_ShipStation>
24
  </modules>
25
 
app/etc/modules/Auctane_ShipStation.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Auctane_ShipStation>
5
- <active>true</active>
6
  <codePool>community</codePool>
7
  </Auctane_ShipStation>
8
  </modules>
2
  <config>
3
  <modules>
4
  <Auctane_ShipStation>
5
+ <active>false</active>
6
  <codePool>community</codePool>
7
  </Auctane_ShipStation>
8
  </modules>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Auctane_ShipStation</name>
4
- <version>1.3.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -9,12 +9,11 @@
9
  <summary>ShipStation is a web-based shipping solution that is integrated with the Magento API for retrieving order information and updating shipping details.</summary>
10
  <description>ShipStation is a web-based shipping solution that is integrated with the Magento API for retrieving order information and updating shipping details.</description>
11
  <notes>Official release.&#xD;
12
- Export custom attributes as custom options to API.&#xD;
13
- </notes>
14
  <authors><author><name>clockworkgeek</name><user>nonproffessional</user><email>nonproffessional@clockworkgeek.com</email></author></authors>
15
- <date>2013-02-21</date>
16
- <time>15:38:18</time>
17
- <contents><target name="magecommunity"><dir name="Auctane"><dir name="ShipStation"><dir name="Block"><dir name="Adminhtml"><dir name="Linkup"><file name="Form.php" hash="68b7c7bc627e89c304cf630c24aa5164"/></dir><file name="Linkup.php" hash="f280d1f6a26e74244898ea16cdf29c9b"/><file name="Pending.php" hash="6bc7a07b5d0b5192db32fefc55b94b08"/></dir></dir><dir name="Helper"><file name="Data.php" hash="cf2bd6a04dd7b88cae8096c2dd548214"/></dir><file name="LICENSE.html" hash="caf0a79ffb5e4719f9f4de286f253a61"/><file name="LICENSE.txt" hash="59563e7be45096d0833dade102989042"/><file name="LICENSE_AFL.txt" hash="45a399f2095030865fb962263ccd7506"/><dir name="Model"><dir name="Mysql4"><dir name="User"><file name="Collection.php" hash="eee6af3b0c7ecf4f4a42eb0b50605d29"/></dir><file name="User.php" hash="296427f3d22c7cc18c0ece7c1afbc278"/></dir><file name="Observer.php" hash="ffb797d5cfc2f0724d20a44140661bed"/><file name="User.php" hash="9e3fad822b8adcd79dd5438d995fc61a"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ShipstationController.php" hash="c7cd0029ed2a0a46d7b16821b1e6a683"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="3021b17f108f3f50230194ff63975481"/><file name="api.xml" hash="3021b17f108f3f50230194ff63975481"/><file name="config.xml" hash="cf916c5f657f8ed1d4d6fe26932d49d5"/></dir><dir name="sql"><dir name="auctaneshipstation_setup"><file name="mysql4-install-1.0.0.php" hash="ab307db58a6d8ec97b5efc8d4eedb349"/></dir></dir></dir><dir name="Api"><dir name="Helper"><file name="Data.php" hash="58f95c074ed97db15d564c973dae5d43"/></dir><file name="LICENSE.html" hash="caf0a79ffb5e4719f9f4de286f253a61"/><file name="LICENSE.txt" hash="59563e7be45096d0833dade102989042"/><file name="LICENSE_AFL.txt" hash="45a399f2095030865fb962263ccd7506"/><dir name="Model"><dir name="Server"><file name="Adapter.php" hash="f0dcba3ca9c9801d42fc52c0d9fefab7"/></dir><dir name="System"><dir name="Source"><dir name="Config"><file name="Customattributes.php" hash="a10dff7d323044151803ce2e30313615"/></dir></dir></dir></dir><dir name="controllers"><file name="AuctaneController.php" hash="b7100ac35e0b3a5d737cde7ef96e19c0"/></dir><dir name="etc"><file name="api.xml" hash="3b6279da3c6a4e5fc71c72f1caf94ae1"/><file name="config.xml" hash="e2d66690c9ac4714d9d10b9a09f0b454"/><file name="system.xml" hash="37d6921d13f1410dbb98f53925fba200"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="auctaneshipstation.xml" hash="d89f79f6de41bb4b23866356f16f48a1"/></dir><dir name="template"><dir name="auctane"><dir name="shipstation"><file name="container.phtml" hash="fb3df40a0baa33a21f6a51d52a90066c"/><file name="launch.phtml" hash="c3fbbc817cbf307fbd500defb2ab9f8e"/><file name="launchform.phtml" hash="b77583e98de80857b185d19a8ce03987"/><file name="linkup.phtml" hash="282a2114ca36efb68f1e681a29739a87"/><file name="pending.phtml" hash="100ec728f3b5ce479e09361bb22960bb"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Auctane_ShipStation.csv" hash="0f9582a3124a762cd6d9531f714d2f82"/></dir></target><target name="mageetc"><dir name="modules"><file name="Auctane_ShipStation.xml" hash="25f744e3243f8472445f3b73f95895c7"/><file name="Auctane_Api.xml" hash="a27b534a3ad08732488959f8bdb72a03"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><file name="shipstation.png" hash="e19a42099ef020edaf7c10d9a068c1c0"/></dir></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Auctane_ShipStation</name>
4
+ <version>1.3.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
9
  <summary>ShipStation is a web-based shipping solution that is integrated with the Magento API for retrieving order information and updating shipping details.</summary>
10
  <description>ShipStation is a web-based shipping solution that is integrated with the Magento API for retrieving order information and updating shipping details.</description>
11
  <notes>Official release.&#xD;
12
+ Include debugging information and limit page size to 100 orders when exporting.</notes>
 
13
  <authors><author><name>clockworkgeek</name><user>nonproffessional</user><email>nonproffessional@clockworkgeek.com</email></author></authors>
14
+ <date>2013-04-09</date>
15
+ <time>12:54:55</time>
16
+ <contents><target name="magecommunity"><dir name="Auctane"><dir name="ShipStation"><dir name="Block"><dir name="Adminhtml"><dir name="Linkup"><file name="Form.php" hash="68b7c7bc627e89c304cf630c24aa5164"/></dir><file name="Linkup.php" hash="f280d1f6a26e74244898ea16cdf29c9b"/><file name="Pending.php" hash="6bc7a07b5d0b5192db32fefc55b94b08"/></dir></dir><dir name="Helper"><file name="Data.php" hash="cf2bd6a04dd7b88cae8096c2dd548214"/></dir><file name="LICENSE.html" hash="caf0a79ffb5e4719f9f4de286f253a61"/><file name="LICENSE.txt" hash="59563e7be45096d0833dade102989042"/><file name="LICENSE_AFL.txt" hash="45a399f2095030865fb962263ccd7506"/><dir name="Model"><dir name="Mysql4"><dir name="User"><file name="Collection.php" hash="eee6af3b0c7ecf4f4a42eb0b50605d29"/></dir><file name="User.php" hash="296427f3d22c7cc18c0ece7c1afbc278"/></dir><file name="Observer.php" hash="ffb797d5cfc2f0724d20a44140661bed"/><file name="User.php" hash="9e3fad822b8adcd79dd5438d995fc61a"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ShipstationController.php" hash="c7cd0029ed2a0a46d7b16821b1e6a683"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="3021b17f108f3f50230194ff63975481"/><file name="api.xml" hash="3021b17f108f3f50230194ff63975481"/><file name="config.xml" hash="9e892b501d6d2489bb07b1be4fbd5063"/></dir><dir name="sql"><dir name="auctaneshipstation_setup"><file name="mysql4-install-1.0.0.php" hash="ab307db58a6d8ec97b5efc8d4eedb349"/></dir></dir></dir><dir name="Api"><dir name="Helper"><file name="Data.php" hash="58f95c074ed97db15d564c973dae5d43"/></dir><file name="LICENSE.html" hash="caf0a79ffb5e4719f9f4de286f253a61"/><file name="LICENSE.txt" hash="59563e7be45096d0833dade102989042"/><file name="LICENSE_AFL.txt" hash="45a399f2095030865fb962263ccd7506"/><dir name="Model"><dir name="Server"><file name="Adapter.php" hash="d5d85e8a36f6c5145f016995ac191e5e"/></dir><dir name="System"><dir name="Source"><dir name="Config"><file name="Customattributes.php" hash="a10dff7d323044151803ce2e30313615"/></dir></dir></dir></dir><dir name="controllers"><file name="AuctaneController.php" hash="b7100ac35e0b3a5d737cde7ef96e19c0"/></dir><dir name="etc"><file name="api.xml" hash="3b6279da3c6a4e5fc71c72f1caf94ae1"/><file name="config.xml" hash="c119f36d7b910805059e3670f0bc8a77"/><file name="system.xml" hash="37d6921d13f1410dbb98f53925fba200"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="auctaneshipstation.xml" hash="d89f79f6de41bb4b23866356f16f48a1"/></dir><dir name="template"><dir name="auctane"><dir name="shipstation"><file name="container.phtml" hash="fb3df40a0baa33a21f6a51d52a90066c"/><file name="launch.phtml" hash="c3fbbc817cbf307fbd500defb2ab9f8e"/><file name="launchform.phtml" hash="b77583e98de80857b185d19a8ce03987"/><file name="linkup.phtml" hash="282a2114ca36efb68f1e681a29739a87"/><file name="pending.phtml" hash="100ec728f3b5ce479e09361bb22960bb"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Auctane_ShipStation.csv" hash="0f9582a3124a762cd6d9531f714d2f82"/></dir></target><target name="mageetc"><dir name="modules"><file name="Auctane_ShipStation.xml" hash="bacef7ff4049dece52644ec7be714ee6"/><file name="Auctane_Api.xml" hash="a27b534a3ad08732488959f8bdb72a03"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><file name="shipstation.png" hash="e19a42099ef020edaf7c10d9a068c1c0"/></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>