Auctane_ShipStation - Version 1.3.23

Version Notes

Official release.



Compatibility with php running as cgi, allows exporting base or store price.

Download this release

Release Info

Developer Classy Llama
Extension Auctane_ShipStation
Version 1.3.23
Comparing to
See all releases


Code changes from version 1.3.22 to 1.3.23

app/code/community/Auctane/Api/Helper/Data.php CHANGED
@@ -33,6 +33,7 @@ class Auctane_Api_Helper_Data extends Mage_Core_Helper_Data
33
  public function fieldsetToXml($fieldset, $source, XMLWriter $xml, $isBundle = 0)
34
  {
35
  $fields = (array) Mage::getConfig()->getFieldset($fieldset);
 
36
  foreach ($fields as $field => $dest) {
37
  if (!$dest->auctaneapi) continue;
38
 
@@ -41,7 +42,7 @@ class Auctane_Api_Helper_Data extends Mage_Core_Helper_Data
41
  ? $source->getDataUsingMethod($field)
42
  : @$source[$field];
43
 
44
- if($isBundle == 1 && $name == 'UnitPrice') {
45
  //continue;
46
  $value = 0;
47
  }
33
  public function fieldsetToXml($fieldset, $source, XMLWriter $xml, $isBundle = 0)
34
  {
35
  $fields = (array) Mage::getConfig()->getFieldset($fieldset);
36
+ $intImportChildProducts = Mage::getStoreConfig('auctaneapi/general/import_child_products');
37
  foreach ($fields as $field => $dest) {
38
  if (!$dest->auctaneapi) continue;
39
 
42
  ? $source->getDataUsingMethod($field)
43
  : @$source[$field];
44
 
45
+ if($isBundle == 1 && $name == 'UnitPrice' && $intImportChildProducts == 1) {
46
  //continue;
47
  $value = 0;
48
  }
app/code/community/Auctane/Api/Model/Action/Export.php CHANGED
@@ -44,7 +44,6 @@ class Auctane_Api_Model_Action_Export {
44
  $response->clearHeaders()
45
  ->setHeader('Content-Type','text/xml; charset='.$apiConfigCharset)
46
  ->setBody($xml->outputMemory(true));
47
-
48
  }
49
 
50
  protected function _getExportPageSize()
@@ -103,8 +102,7 @@ class Auctane_Api_Model_Action_Export {
103
 
104
  if($helper->getExportPriceType($order->getStoreId()) == Auctane_Api_Model_System_Source_Config_Prices::BASE_PRICE) {
105
  $helper->fieldsetToXml('base_sales_order', $order, $xml);
106
- }
107
- else {
108
  $helper->fieldsetToXml('sales_order', $order, $xml);
109
  }
110
 
@@ -125,15 +123,16 @@ class Auctane_Api_Model_Action_Export {
125
 
126
  $xml->endElement(); // Customer
127
 
128
- /** add purchase order nubmer */
129
- Mage::helper('auctaneapi')->writePoNumber($order, $xml);
130
 
131
  $xml->startElement('Items');
132
  /* @var $item Mage_Sales_Model_Order_Item */
133
  $bundleItems = array();
134
  $orderItems = array();
135
-
136
  $intCnt = 0;
 
 
137
  foreach ($order->getItemsCollection($helper->getIncludedProductTypes()) as $item) {
138
  /* @var $product Mage_Catalog_Model_Product */
139
  $product = Mage::getModel('catalog/product')
@@ -142,18 +141,20 @@ class Auctane_Api_Model_Action_Export {
142
  $productId = $product->getId();
143
 
144
  $boolIsBundleProduct = false;
145
-
146
  if($product->getTypeId() === 'bundle'){
147
  //Get all bundle items of this bundle product
148
  $bundleItems = array_flip(Mage::helper('auctaneapi')->getBundleItems($productId));
149
  $boolIsBundleProduct = true;
150
  }
151
-
152
- if(isset($bundleItems[$productId])){
 
 
 
153
  //Remove item from bundle product items
154
  unset($bundleItems[ $productId ]);
155
- $orderItems[$intCnt]['item'] = $item;
156
- $orderItems[$intCnt]['bundle'] = 1;
157
  }else{
158
  //These are items for next processing
159
  $orderItems[$intCnt]['item'] = $item;
@@ -164,8 +165,8 @@ class Auctane_Api_Model_Action_Export {
164
  }
165
  }
166
  $intCnt++;
167
- }
168
-
169
  foreach ($orderItems as $key=>$item) {
170
  $this->_writeOrderItem($item['item'], $xml, $storeId, $item['bundle']);
171
  }
@@ -242,8 +243,7 @@ class Auctane_Api_Model_Action_Export {
242
  if(Mage::helper('auctaneapi')->getExportPriceType($item->getOrder()->getStoreId()) ==
243
  Auctane_Api_Model_System_Source_Config_Prices::BASE_PRICE) {
244
  $helper->fieldsetToXml('base_sales_order_item', $item, $xml, $isBundle);
245
- }
246
- else {
247
  $helper->fieldsetToXml('sales_order_item', $item, $xml, $isBundle);
248
  }
249
 
44
  $response->clearHeaders()
45
  ->setHeader('Content-Type','text/xml; charset='.$apiConfigCharset)
46
  ->setBody($xml->outputMemory(true));
 
47
  }
48
 
49
  protected function _getExportPageSize()
102
 
103
  if($helper->getExportPriceType($order->getStoreId()) == Auctane_Api_Model_System_Source_Config_Prices::BASE_PRICE) {
104
  $helper->fieldsetToXml('base_sales_order', $order, $xml);
105
+ } else {
 
106
  $helper->fieldsetToXml('sales_order', $order, $xml);
107
  }
108
 
123
 
124
  $xml->endElement(); // Customer
125
 
126
+ /** add purchase order nubmer */
127
+ Mage::helper('auctaneapi')->writePoNumber($order, $xml);
128
 
129
  $xml->startElement('Items');
130
  /* @var $item Mage_Sales_Model_Order_Item */
131
  $bundleItems = array();
132
  $orderItems = array();
 
133
  $intCnt = 0;
134
+ //Check for the bundle child product to import
135
+ $intImportChildProducts = Mage::getStoreConfig('auctaneapi/general/import_child_products');
136
  foreach ($order->getItemsCollection($helper->getIncludedProductTypes()) as $item) {
137
  /* @var $product Mage_Catalog_Model_Product */
138
  $product = Mage::getModel('catalog/product')
141
  $productId = $product->getId();
142
 
143
  $boolIsBundleProduct = false;
 
144
  if($product->getTypeId() === 'bundle'){
145
  //Get all bundle items of this bundle product
146
  $bundleItems = array_flip(Mage::helper('auctaneapi')->getBundleItems($productId));
147
  $boolIsBundleProduct = true;
148
  }
149
+ if($intImportChildProducts == 2 && $item->getParentItemId()){
150
+ continue;
151
+ }
152
+
153
+ if(isset($bundleItems[$productId])) {
154
  //Remove item from bundle product items
155
  unset($bundleItems[ $productId ]);
156
+ $orderItems[$intCnt]['item'] = $item;
157
+ $orderItems[$intCnt]['bundle'] = 1;
158
  }else{
159
  //These are items for next processing
160
  $orderItems[$intCnt]['item'] = $item;
165
  }
166
  }
167
  $intCnt++;
168
+ }
169
+
170
  foreach ($orderItems as $key=>$item) {
171
  $this->_writeOrderItem($item['item'], $xml, $storeId, $item['bundle']);
172
  }
243
  if(Mage::helper('auctaneapi')->getExportPriceType($item->getOrder()->getStoreId()) ==
244
  Auctane_Api_Model_System_Source_Config_Prices::BASE_PRICE) {
245
  $helper->fieldsetToXml('base_sales_order_item', $item, $xml, $isBundle);
246
+ } else {
 
247
  $helper->fieldsetToXml('sales_order_item', $item, $xml, $isBundle);
248
  }
249
 
app/code/community/Auctane/Api/Model/Action/Shipnotify.php CHANGED
@@ -126,17 +126,18 @@ class Auctane_Api_Model_Action_Shipnotify {
126
  /* @var $items Mage_Sales_Model_Mysql4_Order_Item_Collection */
127
  $items = $order->getItemsCollection();
128
  $qtys = array();
 
129
  /* @var $item Mage_Sales_Model_Order_Item */
130
  foreach ($items as $item) {
131
- /* collect all items qtys if shipall flag is true */
132
- if($shipAll) {
133
- if ($item->getParentItemId()) {
134
- $qtys[$item->getParentItemId()] = $item->getQtyOrdered();
135
- } else {
136
- $qtys[$item->getId()] = $item->getQtyOrdered();
137
- }
138
- continue;
139
- }
140
  // search for item by SKU
141
  @list($xmlItem) = $xmlItems->xpath(sprintf('//Item/SKU[text()="%s"]/..',
142
  addslashes($item->getSku())));
@@ -145,6 +146,16 @@ class Auctane_Api_Model_Action_Shipnotify {
145
  $qtys[$item->getId()] = (float) $xmlItem->Quantity;
146
  }
147
  }
 
 
 
 
 
 
 
 
 
 
148
  return $qtys;
149
  }
150
 
@@ -168,4 +179,4 @@ class Auctane_Api_Model_Action_Shipnotify {
168
  return $shipment;
169
  }
170
 
171
- }
126
  /* @var $items Mage_Sales_Model_Mysql4_Order_Item_Collection */
127
  $items = $order->getItemsCollection();
128
  $qtys = array();
129
+ $childs = array();
130
  /* @var $item Mage_Sales_Model_Order_Item */
131
  foreach ($items as $item) {
132
+ /* collect all items qtys if shipall flag is true */
133
+ if($shipAll) {
134
+ if ($item->getParentItemId()) {
135
+ $qtys[$item->getParentItemId()] = $item->getQtyOrdered();
136
+ } else {
137
+ $qtys[$item->getId()] = $item->getQtyOrdered();
138
+ }
139
+ continue;
140
+ }
141
  // search for item by SKU
142
  @list($xmlItem) = $xmlItems->xpath(sprintf('//Item/SKU[text()="%s"]/..',
143
  addslashes($item->getSku())));
146
  $qtys[$item->getId()] = (float) $xmlItem->Quantity;
147
  }
148
  }
149
+ //Add child products into the shipments
150
+ $intImportChildProducts = Mage::getStoreConfig('auctaneapi/general/import_child_products');
151
+ if($intImportChildProducts == 2) {
152
+ $orderItems = $order->getAllItems();
153
+ foreach ($orderItems as $objItem) {
154
+ if($objItem->getParentItemId()) {
155
+ $qtys[$objItem->getItemId()] = $qtys[$objItem->getParentItemId()];
156
+ }
157
+ }
158
+ }
159
  return $qtys;
160
  }
161
 
179
  return $shipment;
180
  }
181
 
182
+ }
app/code/community/Auctane/Api/etc/config.xml CHANGED
@@ -241,6 +241,7 @@
241
  <invoiceComment>Issued by Auctane ShipStation.</invoiceComment>
242
  <export_price>1</export_price>
243
  <import_discounts>1</import_discounts>
 
244
  </config>
245
  </auctaneapi>
246
  </default>
241
  <invoiceComment>Issued by Auctane ShipStation.</invoiceComment>
242
  <export_price>1</export_price>
243
  <import_discounts>1</import_discounts>
244
+ <import_child_products>1</import_child_products>
245
  </config>
246
  </auctaneapi>
247
  </default>
app/code/community/Auctane/Api/etc/system.xml CHANGED
@@ -70,6 +70,15 @@
70
  <sort_order>10</sort_order>
71
  <show_in_store>1</show_in_store>
72
  </customattributes>
 
 
 
 
 
 
 
 
 
73
  </fields>
74
  </general>
75
  </groups>
70
  <sort_order>10</sort_order>
71
  <show_in_store>1</show_in_store>
72
  </customattributes>
73
+ <import_child_products translate="label">
74
+ <label>Import Child Products</label>
75
+ <frontend_type>select</frontend_type>
76
+ <sort_order>15</sort_order>
77
+ <source_model>auctaneapi/system_source_config_import</source_model>
78
+ <show_in_default>1</show_in_default>
79
+ <show_in_website>1</show_in_website>
80
+ <show_in_store>1</show_in_store>
81
+ </import_child_products>
82
  </fields>
83
  </general>
84
  </groups>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Auctane_ShipStation</name>
4
- <version>1.3.22</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -12,9 +12,9 @@
12
  &amp;amp;amp;amp;amp;amp;amp;#xD;&amp;amp;amp;amp;amp;amp;#xD;&amp;amp;amp;amp;amp;#xD;&amp;amp;amp;amp;#xD;&amp;amp;amp;#xD;&amp;amp;#xD;&amp;#xD;&#xD;
13
  Compatibility with php running as cgi, allows exporting base or store price.</notes>
14
  <authors><author><name>Classy Llama</name><user>classyllama</user><email>info@classyllama.com</email></author></authors>
15
- <date>2014-07-18</date>
16
- <time>13:39:36</time>
17
- <contents><target name="mageetc"><dir name="modules"><file name="Auctane_Api.xml" hash="a27b534a3ad08732488959f8bdb72a03"/></dir></target><target name="magecommunity"><dir name="Auctane"><dir name="Api"><file name="CHANGELOG.txt" hash="ac302cdb9f343e0ec036b7a846294235"/><dir name="Helper"><file name="Data.php" hash="c7065c53a48b771d2fe01599b2dd2174"/></dir><file name="LICENSE.html" hash="caf0a79ffb5e4719f9f4de286f253a61"/><file name="LICENSE.txt" hash="34410d4f566fdc33f094525a2d9865fa"/><file name="LICENSE_AFL.txt" hash="0e3cb8112c018920eee7a316a2a69103"/><dir name="Model"><dir name="Action"><file name="Export.php" hash="7449780a02f0bbe3c4b7981519368d0f"/><file name="Shipnotify.php" hash="f832a7110377f8c51b44db7f713a45e8"/></dir><file name="Observer.php" hash="35039bba674a42171212e3a13b7800ca"/><dir name="Server"><file name="Adapter.php" hash="2439c54a7fe7bb44c93ee1e00b2e8dcf"/></dir><dir name="System"><dir name="Source"><dir name="Config"><file name="Customattributes.php" hash="a10dff7d323044151803ce2e30313615"/><file name="Import.php" hash="f7e86512477d957d2620084faab48327"/><file name="Prices.php" hash="0869f093096b4ff6d2ae24f14468d782"/></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="050a8434bb63a266dd60c703c4679b3d"/><file name="system.xml" hash="06d0f3194a9d99d41b5b09cb9ad80da9"/></dir><dir name="sql"><dir name="auctaneapi_setup"><file name="mysql4-install-1.3.11.php" hash="17aa8f981f75f1e1d62e8dbdde2f950d"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="auctaneapi"><dir name="css"><file name="master.css" hash="0b35fa9797b3bd868b3725a85d4347af"/></dir><dir name="images"><file name="auctaneapi.png" hash="294d531f2f4f6dd85bdccd124a3057f6"/><file name="btn_bl.png" hash="093ac74aedfd1dd0addbfac3a19ced95"/><file name="header.png" hash="9228dfeb910aa6f3141d40966a6dba32"/><file name="tabs_span_bg.gif" hash="bcabd4fea0d67b181f21779564c2284b"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="auctaneapi.xml" hash="a6fe62d8258e423bee3a129165c0d313"/></dir></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.3.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.23</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
12
  &amp;amp;amp;amp;amp;amp;amp;#xD;&amp;amp;amp;amp;amp;amp;#xD;&amp;amp;amp;amp;amp;#xD;&amp;amp;amp;amp;#xD;&amp;amp;amp;#xD;&amp;amp;#xD;&amp;#xD;&#xD;
13
  Compatibility with php running as cgi, allows exporting base or store price.</notes>
14
  <authors><author><name>Classy Llama</name><user>classyllama</user><email>info@classyllama.com</email></author></authors>
15
+ <date>2014-07-25</date>
16
+ <time>16:06:54</time>
17
+ <contents><target name="mageetc"><dir name="modules"><file name="Auctane_Api.xml" hash="a27b534a3ad08732488959f8bdb72a03"/></dir></target><target name="magecommunity"><dir name="Auctane"><dir name="Api"><file name="CHANGELOG.txt" hash="ac302cdb9f343e0ec036b7a846294235"/><dir name="Helper"><file name="Data.php" hash="570b147833d151bbc42044a9ced0e05a"/></dir><file name="LICENSE.html" hash="caf0a79ffb5e4719f9f4de286f253a61"/><file name="LICENSE.txt" hash="34410d4f566fdc33f094525a2d9865fa"/><file name="LICENSE_AFL.txt" hash="0e3cb8112c018920eee7a316a2a69103"/><dir name="Model"><dir name="Action"><file name="Export.php" hash="e1b7931d98cf868d96bb311d9e6979c7"/><file name="Shipnotify.php" hash="8dbe4b62f1f60f9a49d17ba06c43eec8"/></dir><file name="Observer.php" hash="35039bba674a42171212e3a13b7800ca"/><dir name="Server"><file name="Adapter.php" hash="2439c54a7fe7bb44c93ee1e00b2e8dcf"/></dir><dir name="System"><dir name="Source"><dir name="Config"><file name="Customattributes.php" hash="a10dff7d323044151803ce2e30313615"/><file name="Import.php" hash="f7e86512477d957d2620084faab48327"/><file name="Prices.php" hash="0869f093096b4ff6d2ae24f14468d782"/></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="17552bc312cbd3cfb23e102b528438b6"/><file name="system.xml" hash="91b7c65f17f50a62029008e22dadc0ac"/></dir><dir name="sql"><dir name="auctaneapi_setup"><file name="mysql4-install-1.3.11.php" hash="17aa8f981f75f1e1d62e8dbdde2f950d"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="auctaneapi"><dir name="css"><file name="master.css" hash="0b35fa9797b3bd868b3725a85d4347af"/></dir><dir name="images"><file name="auctaneapi.png" hash="294d531f2f4f6dd85bdccd124a3057f6"/><file name="btn_bl.png" hash="093ac74aedfd1dd0addbfac3a19ced95"/><file name="header.png" hash="9228dfeb910aa6f3141d40966a6dba32"/><file name="tabs_span_bg.gif" hash="bcabd4fea0d67b181f21779564c2284b"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="auctaneapi.xml" hash="a6fe62d8258e423bee3a129165c0d313"/></dir></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>