MocoInsight_Mocoauto - Version 1.5.1.9

Version Notes

1.5.1.9

Removed shipping label (data) from test_orders shippments.

1.5.1.8

test_orders promoted to live.
shipment and temando support now available

1.5.1.7

uncoverted_carts upgrade
test_orders shipment and temando support

1.5.1.6

Testing direct SQL test_unconvertedcarts for BNKR

1.5.1.5

Skipping carts with customer_id = 0 for BNKR

1.5.1.4

Fixed problem with empty unconvertedcarts

1.5.1.3

test_unconvertedcartsAction.

1.5.1.2

Avoid exception if unconvertedcarts product type
fails.

1.5.1.1

Check if Mage::getEdition(); exists before calling.

1.5.1.0

Updates to visits API

1.5.0.6

Updates to visits API

1.5.0.5

New
creditsAction
credit_idsAction

1.5.0.4

Added item id to wishlist items

1.5.0.3

Diagnostic routine for unconverted carts

1.5.0.2

Maintenance release.

1.5.0.0

OrdersNoPaymentAction for sites with non standard payment methods.

1.4.9

Exception handle for payment method.
Updated wishlistsAction
New product_IdsAction
New customer_IdsAction
New order_IdsAction
unconvertedcarts fix for Magento < 1.7

1.4.7

Support for multiple web sites on single Magento instance.

1.4.6

Test actions for multi web site catalog.

1.4.5

Diagnostic: gte - ordered by entity_id

1.4.4

Faster unconvertedcarts.
CustomerTaxClass added to orders and customer Actions

1.4.3

New attrInfoAction and entityTypeInfoAction added to tracked changes in Magento data.

1.4.2

Disconnect API version from module version for sites that cache module XML file

1.4.1

Improved order processing speed.
Multi store URL info.
Shipping address tracked.
gte option for orders,customers, products, carts and subscribers.
Status option for subscribersAction
Update carts action skip non identifed carts.

1.4.0

Split stats action into
stats and logstats

Updated customersAction to return custom attributes.

1.3.9

Added eavinfo_catalogAction

Products action now retuns full url of product images.

testing new testcustomerAction

1.3.8

Changed table exists function
mocoauto_api_error - API errors prefix

1.3.7

Added non sensitive payment info to orderAction

1.3.5

Faster uncovertedcarts

1.3.4

log_all_joined

1.3.3

Added rulesAction - for details on coupon and shopping carts rule.

1.3.2

Exception handles for uncoverted carts.
Changed catalogue tax rate processing.

1.3.1

Added graceful exception handling for installations that have misconfigured product attributes

1.3.0

Check direct SQL methods defined
exproducts
exstats
report version of php

1.2.9

Default tax rate fro products returned with producAction

1.2.8

storesAction now returns store config data

1.2.7

log stats function calculates using direct SQL

1.2.6

StatsAction now returns size of log files

1.2.5

Speed up stocklevelAction, now only returns non zero inventory

WishlistAction now includes wishListItemId

1.2.4

Added wishlistsAction
Added unconvertedcartsAction

Fix - log actions now check if table exists

1.2.3

Fix to Observer.php

1.2.2

Added subscribersAction
Added storesAction

1.2.1

ordersAction - now uses billing address as some products (Virtual) won't have a delivery address and checks that object exists

1.2.0

ordersAction - added shpping address
productsAction - added end of record marker

stocklevelsAction - New

Added log_ actions

1.1.7

Added malformed error

Returns API version number with failed calls

1.1.6

Changed API header name to work with sites that use additional authorisation now:

mocoapi: apikey= THE API KEY

1.1.5
Updated stats API now includes:

Version of magento
System date/time
added success true for succesful requests
changed product category to moco_category

Download this release

Release Info

Developer Rob Davies
Extension MocoInsight_Mocoauto
Version 1.5.1.9
Comparing to
See all releases


Code changes from version 1.5.1.8 to 1.5.1.9

app/code/community/MocoInsight/Mocoauto/controllers/ApiController.php CHANGED
@@ -33,7 +33,7 @@
33
  // sql_anytableAction()
34
 
35
 
36
- define("apiversion","1.5.1.8");
37
 
38
  class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Action
39
  {
@@ -684,6 +684,133 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
684
  ->setHeader('Content-type', 'application/json', true);
685
  return $this;
686
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
687
 
688
 
689
  public function eavinfo_catalogAction()
33
  // sql_anytableAction()
34
 
35
 
36
+ define("apiversion","1.5.1.9");
37
 
38
  class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Action
39
  {
684
  ->setHeader('Content-type', 'application/json', true);
685
  return $this;
686
  }
687
+ // ordersAction - return all information on a order
688
+ // 1.5.1.9 - only request specified shippment attributes as shipping label can get very big and we don't need it or much else.
689
+ //
690
+ public function test_ordersAction()
691
+ {
692
+ if(!$this->_authorise()) {
693
+ return $this;
694
+ }
695
+
696
+ $sections = explode('/', trim($this->getRequest()->getPathInfo(), '/'));
697
+
698
+ $offset = $this->getRequest()->getParam('offset', 0);
699
+ $page_size = $this->getRequest()->getParam('page_size', 20);
700
+ $since = $this->getRequest()->getParam('since','ALL');
701
+ $gTE = $this->getRequest()->getParam('gte', 'ALL');
702
+
703
+ $_orderCol = Mage::getModel('sales/order')->getCollection()->addAttributeToSelect('*');
704
+
705
+
706
+ if($since != 'ALL'){
707
+ $_orderCol->addAttributeToFilter('updated_at', array('gteq' =>$since));
708
+ }
709
+
710
+ if($gTE != 'ALL'){
711
+ $_orderCol->addFieldToFilter('entity_id', array('gteq' =>$gTE));
712
+ $_orderCol->getSelect()->limit($page_size, ($offset * $page_size))->order('entity_id');
713
+ }
714
+ else{
715
+ $_orderCol->getSelect()->limit($page_size, ($offset * $page_size))->order('updated_at');
716
+ }
717
+
718
+ //Mage::log('SQL Query: '.$_orderCol->getSelect());
719
+
720
+ // Check if the Termnado tables exsists set flag so we read shipments later on.
721
+ $tablename = 'temando_shipment';
722
+ $_read = Mage::getSingleton('core/resource')->getConnection('core_read');
723
+
724
+ if($_read ->isTableExists($tablename)){ //Table does exist
725
+ $TEMANDO_FLAG='TRUE';
726
+ }
727
+
728
+ $orders = array();
729
+
730
+ foreach($_orderCol as $_order) {
731
+
732
+ $order = array();
733
+
734
+ try{
735
+ $order['moco_start_of_order_record'] = 'True';
736
+ $orderdetails = array();
737
+ $orderdetails = $_order->toArray();
738
+ foreach ($orderdetails as $key => $value) {
739
+ $order[$key] = $value;
740
+ }
741
+ if(is_object($_order->getPayment()) && method_exists($_order->getPayment()->getMethodInstance(), 'getTitle')){
742
+ $order['payment_method'] = $_order->getPayment()->getMethodInstance()->getTitle();
743
+ }
744
+ else{
745
+ $order['payment_method'] = 'Unable to get payment_method';
746
+ }
747
+
748
+ if(is_object($_order->getBillingAddress())){
749
+ $_billing_address = $_order->getBillingAddress();
750
+ $billaddrdetails = array();
751
+ $billaddrdetails[] = $_billing_address->toArray();
752
+ $order['moco_address'] = $billaddrdetails;
753
+ }
754
+
755
+ if(is_object($_order->getShippingAddress())){
756
+
757
+ $_shipping_address = $_order->getShippingAddress();
758
+ $shipaddrdetails = array();
759
+ $shipaddrdetails[] = $_shipping_address->toArray();
760
+ $order['moco_ship_address'] = $shipaddrdetails;
761
+ }
762
+
763
+
764
+ if(is_object($_order->getShipmentsCollection())){
765
+ $_orderShipmentsCol = $_order->getShipmentsCollection();
766
+ $ordershipments = array();
767
+ foreach($_orderShipmentsCol as $_ordershipment){
768
+ $ordershipments['entity_id'] = $_ordershipment->getEntityId();
769
+ $ordershipments['order_id'] = $_ordershipment->getOrderId();
770
+ $ordershipments['store_id'] = $_ordershipment->getStoreId();
771
+ $ordershipments['increment_id'] = $_ordershipment->getIncrementId();
772
+ $ordershipments['created_at'] = $_ordershipment->getCreatedAt();
773
+ $ordershipments['updated_at'] = $_ordershipment->getUpdatedAt();
774
+ }
775
+ $order['moco_shipments'] = $ordershipments;
776
+ }
777
+
778
+
779
+ // If the Temanado flag is set then get any shippiong records that match the order number.
780
+ if($TEMANDO_FLAG == 'TRUE'){ //Table does exist
781
+ $temandodata = array();
782
+ $query = 'select id, order_id, anticipated_cost, ready_date, ready_time from ' . $tablename . ' where order_id = "' . $_order->getEntityId() . '"';
783
+ //Mage::log('DBG SQL: '. $query);
784
+ $readresults = $_read->fetchAll($query);
785
+ $temandodata = $readresults;
786
+ $order['moco_temandodata'] = $temandodata;
787
+ }
788
+
789
+
790
+ $_orderItemsCol = $_order->getItemsCollection();
791
+ $orderitems = array();
792
+ foreach($_orderItemsCol as $_orderitem){
793
+ $orderitems[] = $_orderitem->toArray();
794
+ }
795
+ $order['moco_tls'] = $orderitems;
796
+
797
+
798
+ $order['moco_end_of_order_record'] = 'True';
799
+ }
800
+ catch (Exception $e) {
801
+ $order['mocoauto_api_error'] = 'order record: ' . $e->getMessage();
802
+ }
803
+ $orders[] = $order;
804
+
805
+ }
806
+
807
+ $this->getResponse()
808
+ ->setBody(json_encode($orders))
809
+ ->setHttpResponseCode(200)
810
+ ->setHeader('Content-type', 'application/json', true);
811
+ return $this;
812
+ }
813
+
814
 
815
 
816
  public function eavinfo_catalogAction()
app/code/community/MocoInsight/Mocoauto/etc/config.xml CHANGED
@@ -4,7 +4,7 @@
4
  <config>
5
  <modules>
6
  <MocoInsight_Mocoauto>
7
- <version>1.5.1.8</version>
8
  </MocoInsight_Mocoauto>
9
  </modules>
10
  <global>
4
  <config>
5
  <modules>
6
  <MocoInsight_Mocoauto>
7
+ <version>1.5.1.9</version>
8
  </MocoInsight_Mocoauto>
9
  </modules>
10
  <global>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>MocoInsight_Mocoauto</name>
4
- <version>1.5.1.8</version>
5
  <stability>stable</stability>
6
  <license>OSL v1.0.0</license>
7
  <channel>community</channel>
@@ -11,7 +11,12 @@
11
  &#xD;
12
  &#xD;
13
  </description>
14
- <notes>1.5.1.8&#xD;
 
 
 
 
 
15
  &#xD;
16
  test_orders promoted to live.&#xD;
17
  shipment and temando support now available&#xD;
@@ -245,9 +250,9 @@ System date/time&#xD;
245
  added success true for succesful requests&#xD;
246
  changed product category to moco_category</notes>
247
  <authors><author><name>Rob Davies</name><user>mocoinsight</user><email>rob.davies@mocoinsight.com</email></author></authors>
248
- <date>2015-05-07</date>
249
- <time>06:57:39</time>
250
- <contents><target name="magecommunity"><dir name="MocoInsight"><dir name="Mocoauto"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Buttons"><file name="Generate.php" hash="7690d026d99e31732279e6aa5b6b1def"/></dir></dir><file name="Menu.php" hash="1017af5f89545915f3f28be637e07a0c"/></dir></dir><dir name="Helper"><file name="Data.php" hash="4b53061397fec9446830ef218aba4055"/><file name="JWT.php" hash="6610b92191eccedb8edcf993730c3dc0"/></dir><dir name="Model"><file name="Observer.php" hash="c2cc2f396fedd682268457d17dd045b1"/><dir name="Source"><file name="Views.php" hash="c1ddaf4c7bb51c3907dd72b4e21b1897"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="MocoautoController.php" hash="6665fb22806ef20ee59e88a638ca6359"/></dir><file name="Api2OrdersController.php" hash="b9fa4922f70212b8b0fbf5ccc12a3e5b"/><file name="ApiController.php" hash="7ee897348813c9dba7bca8c15b4ef2d9"/></dir><dir name="etc"><file name="config.xml" hash="54f79dc2c4833f83d674fc77f8bb662c"/><file name="orig.config.xml" hash="863bd2bdfefde5ef9f6c9b30691f4bb4"/><file name="system.xml" hash="5d86b7d939b85826c7ac4d4496f80900"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mocoauto.xml" hash="7dd142354c78e773490c552bbcc3b408"/></dir><dir name="template"><dir name="mocoauto"><dir name="config"><file name="button-generate.phtml" hash="d2ff89c8f1f78e748ac998bd13e61750"/><file name="link.phtml" hash="75c61cac6bdd33ed914f8618b5698598"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="mocoauto.xml" hash="a12a0e1dc675b9ac675181373299e36a"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="MocoInsight_Mocoauto.xml" hash="1ec387f21726f6c7ea3ea216c47340d9"/></dir></target><target name="magelocale"><dir name="en_US"><file name="MocoInsight_Mocoauto.csv" hash="9b508561f871f93fa3158014baebf02b"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="mocoauto"><file name="button.png" hash="58e62edb7f4be46e3b29c0bb774c7ad7"/><file name="icon.png" hash="b5bfce535c987d1e9e604823ac4b3943"/><file name="mocoauto.css" hash="3cd28072e5c2f2b656dd04c06288165b"/></dir></dir></dir></dir></target></contents>
251
  <compatible/>
252
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
253
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>MocoInsight_Mocoauto</name>
4
+ <version>1.5.1.9</version>
5
  <stability>stable</stability>
6
  <license>OSL v1.0.0</license>
7
  <channel>community</channel>
11
  &#xD;
12
  &#xD;
13
  </description>
14
+ <notes>1.5.1.9&#xD;
15
+ &#xD;
16
+ Removed shipping label (data) from test_orders shippments.&#xD;
17
+ &#xD;
18
+ &#xD;
19
+ 1.5.1.8&#xD;
20
  &#xD;
21
  test_orders promoted to live.&#xD;
22
  shipment and temando support now available&#xD;
250
  added success true for succesful requests&#xD;
251
  changed product category to moco_category</notes>
252
  <authors><author><name>Rob Davies</name><user>mocoinsight</user><email>rob.davies@mocoinsight.com</email></author></authors>
253
+ <date>2015-05-27</date>
254
+ <time>01:41:28</time>
255
+ <contents><target name="magecommunity"><dir name="MocoInsight"><dir name="Mocoauto"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Buttons"><file name="Generate.php" hash="7690d026d99e31732279e6aa5b6b1def"/></dir></dir><file name="Menu.php" hash="1017af5f89545915f3f28be637e07a0c"/></dir></dir><dir name="Helper"><file name="Data.php" hash="4b53061397fec9446830ef218aba4055"/><file name="JWT.php" hash="6610b92191eccedb8edcf993730c3dc0"/></dir><dir name="Model"><file name="Observer.php" hash="c2cc2f396fedd682268457d17dd045b1"/><dir name="Source"><file name="Views.php" hash="c1ddaf4c7bb51c3907dd72b4e21b1897"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="MocoautoController.php" hash="6665fb22806ef20ee59e88a638ca6359"/></dir><file name="Api2OrdersController.php" hash="b9fa4922f70212b8b0fbf5ccc12a3e5b"/><file name="ApiController.php" hash="ec9ed643de725a38128614303c4c9620"/></dir><dir name="etc"><file name="config.xml" hash="626620114bbd450a2e8cdb1d77090bbb"/><file name="orig.config.xml" hash="863bd2bdfefde5ef9f6c9b30691f4bb4"/><file name="system.xml" hash="5d86b7d939b85826c7ac4d4496f80900"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mocoauto.xml" hash="7dd142354c78e773490c552bbcc3b408"/></dir><dir name="template"><dir name="mocoauto"><dir name="config"><file name="button-generate.phtml" hash="d2ff89c8f1f78e748ac998bd13e61750"/><file name="link.phtml" hash="75c61cac6bdd33ed914f8618b5698598"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="mocoauto.xml" hash="a12a0e1dc675b9ac675181373299e36a"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="MocoInsight_Mocoauto.xml" hash="1ec387f21726f6c7ea3ea216c47340d9"/></dir></target><target name="magelocale"><dir name="en_US"><file name="MocoInsight_Mocoauto.csv" hash="9b508561f871f93fa3158014baebf02b"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="mocoauto"><file name="button.png" hash="58e62edb7f4be46e3b29c0bb774c7ad7"/><file name="icon.png" hash="b5bfce535c987d1e9e604823ac4b3943"/><file name="mocoauto.css" hash="3cd28072e5c2f2b656dd04c06288165b"/></dir></dir></dir></dir></target></contents>
256
  <compatible/>
257
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
258
  </package>