MocoInsight_Mocoauto - Version 1.5.0.4

Version Notes

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.0.4
Comparing to
See all releases


Code changes from version 1.5.0.2 to 1.5.0.4

app/code/community/MocoInsight/Mocoauto/controllers/ApiController.php CHANGED
@@ -34,7 +34,7 @@
34
  // product_idsAction
35
 
36
 
37
- define("apiversion","1.5.0.2");
38
 
39
  class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Action
40
  {
@@ -1683,6 +1683,8 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
1683
  $_cartsCol->addFieldToFilter('items_count', array('neq' => 0)); // If date filter supplied only include carts with items
1684
  }
1685
 
 
 
1686
  if($gTE != 'ALL'){
1687
  $_cartsCol->addFieldToFilter('entity_id', array('gteq' =>$gTE)); // If gte set include records GTE gte
1688
  }
@@ -1757,6 +1759,132 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
1757
  ->setHeader('Content-type', 'application/json', true);
1758
  return $this;
1759
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1760
 
1761
  public function ex_unconvertedcartsAction()//This query returns only no empty carts when no dat filter applied
1762
  {
@@ -1857,6 +1985,7 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
1857
 
1858
  foreach($_wishlistitemsCol as $_wishlistitem){
1859
  $wishlistitem = array();
 
1860
  $wishlistitem['store_id'] = $_wishlistitem->getStoreId();
1861
  $wishlistitem['product_id'] = $_wishlistitem->getProductId();
1862
  $wishlistitem['product_qty'] = $_wishlistitem->getQty();
34
  // product_idsAction
35
 
36
 
37
+ define("apiversion","1.5.0.4");
38
 
39
  class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Action
40
  {
1683
  $_cartsCol->addFieldToFilter('items_count', array('neq' => 0)); // If date filter supplied only include carts with items
1684
  }
1685
 
1686
+ // If using gte we want to sort by entity id
1687
+
1688
  if($gTE != 'ALL'){
1689
  $_cartsCol->addFieldToFilter('entity_id', array('gteq' =>$gTE)); // If gte set include records GTE gte
1690
  }
1759
  ->setHeader('Content-type', 'application/json', true);
1760
  return $this;
1761
  }
1762
+ public function test_unconvertedcartsAction()
1763
+ {
1764
+ if(!$this->_authorise()) {
1765
+ return $this;
1766
+ }
1767
+
1768
+ $sections = explode('/', trim($this->getRequest()->getPathInfo(), '/'));
1769
+
1770
+ $offset = $this->getRequest()->getParam('offset', 0);
1771
+ $page_size = $this->getRequest()->getParam('page_size', 20);
1772
+ $since = $this->getRequest()->getParam('since', 'ALL');
1773
+ $gTE = $this->getRequest()->getParam('gte', 'ALL');
1774
+
1775
+ $_cartsCol = Mage::getResourceModel('sales/quote_collection')->addFieldToFilter('is_active', '1'); // 1 = quote has not been conveted to an order
1776
+
1777
+ $magentoVersion = Mage::getVersion();
1778
+ if (version_compare($magentoVersion, '1.7', '>=')){
1779
+ //Mage::log("Version is above check");
1780
+ $aboveVersion17Flag = 1;
1781
+ }
1782
+ else {
1783
+ //Mage::log("Version is below check");
1784
+ $aboveVersion17Flag = 0;
1785
+ }
1786
+
1787
+ if($aboveVersion17Flag){ // This will only work with Magento > 1.6
1788
+ $_cartsCol->addFieldToFilter( // If there is no email or customer id we dont want the cart.
1789
+ array(
1790
+ 'customer_id', //attribute_1 with key 0
1791
+ 'customer_email', //attribute_2 with key 1
1792
+ ),
1793
+ array(
1794
+ array('notnull'=>1), // This form creates a NOT NULL query.
1795
+ array('notnull'=>1),
1796
+ )
1797
+ );
1798
+ }
1799
+
1800
+ if($since != 'ALL'){
1801
+ $_cartsCol->addFieldToFilter('updated_at', array('gteq' =>$since)); // If no date filter include empty carts
1802
+ }
1803
+ else{
1804
+ $_cartsCol->addFieldToFilter('items_count', array('neq' => 0)); // If date filter supplied only include carts with items
1805
+ }
1806
+
1807
+ // If using gte we want to sort by entity id
1808
+
1809
+ if($gTE != 'ALL'){
1810
+ $_cartsCol->addFieldToFilter('entity_id', array('gteq' =>$gTE)); // If gte set include records GTE gte
1811
+ $_cartsCol->getSelect()->limit($page_size, ($offset * $page_size))->order('entity_id');
1812
+ }
1813
+ else{
1814
+ $_cartsCol->getSelect()->limit($page_size, ($offset * $page_size))->order('updated_at');
1815
+ }
1816
+
1817
+ //Mage::log((string) $_cartsCol->getSelect());
1818
+
1819
+ $carts = array();
1820
+
1821
+
1822
+ foreach($_cartsCol as $_cart) {
1823
+ $cart = array();
1824
+
1825
+ try {
1826
+ $cart['moco_start_of_cart_record'] = 'True';
1827
+ $cartdetails = array();
1828
+
1829
+ if(!$aboveVersion17Flag && !$_cart->getCustomerId() && !$_cart->getCustomerEmail()){
1830
+ //Mage::log($_cart->getEntityId() . " " . $_cart->getCustomerEmail() . " " . $_cart->getCustomerId());
1831
+ $cart['moco_no_cart_identification_information'] = 'True';
1832
+ }
1833
+ else{
1834
+ $cartdetails = $_cart->toArray();
1835
+
1836
+ foreach ($cartdetails as $key =>$value){
1837
+ $cart[$key] = $value;
1838
+ }
1839
+
1840
+ $_cartItemsCol = $_cart -> getItemsCollection();
1841
+ $cartitems = array();
1842
+
1843
+ foreach($_cartItemsCol as $_cartitem){
1844
+ $cartitem = array();
1845
+ try{
1846
+ $cartitem['item_id'] = $_cartitem->getItemId();
1847
+ $cartitem['parent_id'] = $_cartitem->getParentId();
1848
+ $cartitem['product_id'] = $_cartitem->getProductId();
1849
+ $cartitem['product_sku'] = $_cartitem->getSku();
1850
+ $cartitem['product_qty'] = $_cartitem->getQty();
1851
+ $cartitem['updated_at'] = $_cartitem->getUpdatedAt();
1852
+ $cartitem['product_name'] = $_cartitem->getName();
1853
+ $cartitem['product_type'] = $_cartitem->getProductType();
1854
+ $cartitem['base_price'] = $_cartitem->getBasePrice();
1855
+ $cartitem['base_tax_amount'] = $_cartitem->getBaseTaxAmount();
1856
+ $cartitem['base_discount_amount'] = $_cartitem->getBaseDiscountAmount();
1857
+ $cartitem['base_cost'] = $_cartitem->getBaseCost();
1858
+ $cartitem['base_price_incl_tax'] = $_cartitem->getBasePriceInclTax();
1859
+ }
1860
+ catch(Exception $e) {
1861
+ $cartitem['mocoauto_api_error'] = 'moco_unable_to_read_cartitem: ' . $e->getMessage();
1862
+ }
1863
+
1864
+ $cartitems[] = $cartitem;
1865
+ }
1866
+
1867
+ $cart['moco_cart_items'] = $cartitems;
1868
+ }
1869
+
1870
+ $cart['moco_end_of_cart_record'] = 'True';
1871
+
1872
+ }
1873
+ catch(Exception $e) {
1874
+ $cart['mocoauto_api_error'] = 'moco_unable_to_read_cart: ' . $e->getMessage();
1875
+ }
1876
+
1877
+ $carts[] = $cart;
1878
+
1879
+ }
1880
+
1881
+ $this->getResponse()
1882
+ ->setBody(json_encode($carts))
1883
+ ->setHttpResponseCode(200)
1884
+ ->setHeader('Content-type', 'application/json', true);
1885
+ return $this;
1886
+ }
1887
+
1888
 
1889
  public function ex_unconvertedcartsAction()//This query returns only no empty carts when no dat filter applied
1890
  {
1985
 
1986
  foreach($_wishlistitemsCol as $_wishlistitem){
1987
  $wishlistitem = array();
1988
+ $wishlistitem['item_id'] = $_wishlistitem->getId();
1989
  $wishlistitem['store_id'] = $_wishlistitem->getStoreId();
1990
  $wishlistitem['product_id'] = $_wishlistitem->getProductId();
1991
  $wishlistitem['product_qty'] = $_wishlistitem->getQty();
app/code/community/MocoInsight/Mocoauto/etc/config.xml CHANGED
@@ -4,7 +4,7 @@
4
  <config>
5
  <modules>
6
  <MocoInsight_Mocoauto>
7
- <version>1.5.0.2</version>
8
  </MocoInsight_Mocoauto>
9
  </modules>
10
  <global>
4
  <config>
5
  <modules>
6
  <MocoInsight_Mocoauto>
7
+ <version>1.5.0.4</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.0.2</version>
5
  <stability>stable</stability>
6
  <license>OSL v1.0.0</license>
7
  <channel>community</channel>
@@ -11,7 +11,15 @@
11
  &#xD;
12
  &#xD;
13
  </description>
14
- <notes>1.5.0.2&#xD;
 
 
 
 
 
 
 
 
15
  &#xD;
16
  Maintenance release.&#xD;
17
  &#xD;
@@ -187,9 +195,9 @@ System date/time&#xD;
187
  added success true for succesful requests&#xD;
188
  changed product category to moco_category</notes>
189
  <authors><author><name>Rob Davies</name><user>mocoinsight</user><email>rob.davies@mocoinsight.com</email></author></authors>
190
- <date>2014-11-18</date>
191
- <time>02:42:31</time>
192
- <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="22f83405d4629d80bdd6e6269195bc43"/></dir><dir name="etc"><file name="config.xml" hash="de7e292aea6440c04f37b8df6170e3b2"/><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>
193
  <compatible/>
194
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
195
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>MocoInsight_Mocoauto</name>
4
+ <version>1.5.0.4</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.0.4&#xD;
15
+ &#xD;
16
+ Added item id to wishlist items&#xD;
17
+ &#xD;
18
+ 1.5.0.3&#xD;
19
+ &#xD;
20
+ Diagnostic routine for unconverted carts&#xD;
21
+ &#xD;
22
+ 1.5.0.2&#xD;
23
  &#xD;
24
  Maintenance release.&#xD;
25
  &#xD;
195
  added success true for succesful requests&#xD;
196
  changed product category to moco_category</notes>
197
  <authors><author><name>Rob Davies</name><user>mocoinsight</user><email>rob.davies@mocoinsight.com</email></author></authors>
198
+ <date>2015-01-13</date>
199
+ <time>05:29:36</time>
200
+ <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="260e85f7a31b845f12ad8b83e5a2cfbc"/></dir><dir name="etc"><file name="config.xml" hash="33d1703f2ad0f7e8377897dcd95f119e"/><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>
201
  <compatible/>
202
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
203
  </package>