Version Notes
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
Release Info
Developer | Rob Davies |
Extension | MocoInsight_Mocoauto |
Version | 1.5.0.2 |
Comparing to | |
See all releases |
Code changes from version 1.4.7 to 1.5.0.2
- app/code/community/MocoInsight/Mocoauto/controllers/Api2OrdersController.php +161 -0
- app/code/community/MocoInsight/Mocoauto/controllers/ApiController.php +298 -45
- app/code/community/MocoInsight/Mocoauto/etc/config.xml +1 -1
- app/code/community/MocoInsight/Mocoauto/etc/{rob.config → orig.config.xml} +1 -1
- package.xml +22 -5
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
//
|
3 |
+
// Make sure you update version in /var/www/html/app/code/community/MocoInsight/Mocoauto/etc/config.xml
|
4 |
+
//
|
5 |
+
// DEBUG example "Mage::log('DBG Count: '.$customercount);"
|
6 |
+
//
|
7 |
+
// Provides the following actions via a RestAPI
|
8 |
+
//
|
9 |
+
// ordersAction
|
10 |
+
|
11 |
+
|
12 |
+
define("apiversion","2.0.0");
|
13 |
+
|
14 |
+
class MocoInsight_Mocoauto_Api2OrdersController extends Mage_Core_Controller_Front_Action
|
15 |
+
{
|
16 |
+
|
17 |
+
|
18 |
+
|
19 |
+
public function _authorise()
|
20 |
+
{
|
21 |
+
$tokenString = $this->getRequest()->getHeader('mocoapi');
|
22 |
+
|
23 |
+
$token = null;
|
24 |
+
$matches = array();
|
25 |
+
if(preg_match('/apikey="([a-z0-9]+)"/', $tokenString, $matches)) {
|
26 |
+
$token = $matches[1];
|
27 |
+
}
|
28 |
+
|
29 |
+
$apiToken = Mage::helper('mocoauto')->getApiToken(false);
|
30 |
+
|
31 |
+
// Check API enabled
|
32 |
+
|
33 |
+
if(!Mage::getStoreConfig('mocoauto/api/enabled')) {
|
34 |
+
$this->getResponse()
|
35 |
+
->setBody(json_encode(array('success' => false, 'message' => 'API access disabled', 'MocoAPI version' =>apiversion)))
|
36 |
+
->setHttpResponseCode(403)
|
37 |
+
->setHeader('Content-type', 'application/json', true);
|
38 |
+
return false;
|
39 |
+
}
|
40 |
+
|
41 |
+
// Check the token passed in the header
|
42 |
+
if(!$token || $token != $apiToken) {
|
43 |
+
$this->getResponse()
|
44 |
+
->setBody(json_encode(array('success' => false, 'message' => 'Not authorised','MocoAPI version' => apiversion)))
|
45 |
+
->setHttpResponseCode(401)
|
46 |
+
->setHeader('Content-type', 'application/json', true);
|
47 |
+
return false;
|
48 |
+
}
|
49 |
+
|
50 |
+
|
51 |
+
// Check the URL doesnt have anything apended to it
|
52 |
+
if(substr_count($this->getRequest()->getPathInfo(), '/') !=3) {
|
53 |
+
$this->getResponse()
|
54 |
+
->setBody(json_encode(array('success' => false, 'message' => 'Malformed url')))
|
55 |
+
->setHttpResponseCode(401)
|
56 |
+
->setHeader('Content-type', 'application/json', true);
|
57 |
+
return false;
|
58 |
+
}
|
59 |
+
|
60 |
+
|
61 |
+
return true;
|
62 |
+
}
|
63 |
+
|
64 |
+
public function ordersAction()
|
65 |
+
{
|
66 |
+
|
67 |
+
|
68 |
+
if(!$this->_authorise()) {
|
69 |
+
return $this;
|
70 |
+
}
|
71 |
+
|
72 |
+
$sections = explode('/', trim($this->getRequest()->getPathInfo(), '/'));
|
73 |
+
|
74 |
+
$offset = $this->getRequest()->getParam('offset', 0);
|
75 |
+
$page_size = $this->getRequest()->getParam('page_size', 20);
|
76 |
+
$since = $this->getRequest()->getParam('since','ALL');
|
77 |
+
$gTE = $this->getRequest()->getParam('gte', 'ALL');
|
78 |
+
|
79 |
+
$_orderCol = Mage::getModel('sales/order')->getCollection()->addAttributeToSelect('*');
|
80 |
+
|
81 |
+
|
82 |
+
if($since != 'ALL'){
|
83 |
+
$_orderCol->addAttributeToFilter('updated_at', array('gteq' =>$since));
|
84 |
+
}
|
85 |
+
|
86 |
+
if($gTE != 'ALL'){
|
87 |
+
$_orderCol->addFieldToFilter('entity_id', array('gteq' =>$gTE));
|
88 |
+
$_orderCol->getSelect()->limit($page_size, ($offset * $page_size))->order('entity_id');
|
89 |
+
}
|
90 |
+
else{
|
91 |
+
$_orderCol->getSelect()->limit($page_size, ($offset * $page_size))->order('updated_at');
|
92 |
+
}
|
93 |
+
|
94 |
+
//Mage::log('SQL Query: '.$_orderCol->getSelect());
|
95 |
+
|
96 |
+
|
97 |
+
$orders = array();
|
98 |
+
|
99 |
+
foreach($_orderCol as $_order) {
|
100 |
+
|
101 |
+
$order = array();
|
102 |
+
|
103 |
+
try{
|
104 |
+
$order['moco_start_of_order_record'] = 'True';
|
105 |
+
$orderdetails = array();
|
106 |
+
$orderdetails = $_order->toArray();
|
107 |
+
foreach ($orderdetails as $key => $value) {
|
108 |
+
$order[$key] = $value;
|
109 |
+
}
|
110 |
+
if(is_object($_order->getPayment())){
|
111 |
+
$order['payment_method'] = $_order->getPayment()->getMethodInstance()->getTitle();
|
112 |
+
}
|
113 |
+
else{
|
114 |
+
$order['payment_method'] = 'Unable to get payment_method';
|
115 |
+
}
|
116 |
+
|
117 |
+
// Removing Tax Class as the customer really wanted VAT number
|
118 |
+
// $_quote = Mage::getModel('sales/quote')->load($_order->getQuoteId());
|
119 |
+
// $taxClassId = $_quote->getCustomerTaxClassId();
|
120 |
+
// $_taxClass = Mage::getModel('tax/class')->load($taxClassId);
|
121 |
+
// $order['moco_customer_tax_class'] = $_taxClass->getClassName();
|
122 |
+
|
123 |
+
if(is_object($_order->getBillingAddress())){
|
124 |
+
$_billing_address = $_order->getBillingAddress();
|
125 |
+
$billaddrdetails = array();
|
126 |
+
$billaddrdetails[] = $_billing_address->toArray();
|
127 |
+
$order['moco_address'] = $billaddrdetails;
|
128 |
+
}
|
129 |
+
|
130 |
+
if(is_object($_order->getShippingAddress())){
|
131 |
+
|
132 |
+
$_shipping_address = $_order->getShippingAddress();
|
133 |
+
$shipaddrdetails = array();
|
134 |
+
$shipaddrdetails[] = $_shipping_address->toArray();
|
135 |
+
$order['moco_ship_address'] = $shipaddrdetails;
|
136 |
+
}
|
137 |
+
|
138 |
+
$_orderItemsCol = $_order->getItemsCollection();
|
139 |
+
$orderitems = array();
|
140 |
+
foreach($_orderItemsCol as $_orderitem){
|
141 |
+
$orderitems[] = $_orderitem->toArray();
|
142 |
+
}
|
143 |
+
$order['moco_tls'] = $orderitems;
|
144 |
+
|
145 |
+
|
146 |
+
$order['moco_end_of_order_record'] = 'True';
|
147 |
+
}
|
148 |
+
catch (Exception $e) {
|
149 |
+
$order['mocoauto_api_error'] = 'order record: ' . $e->getMessage();
|
150 |
+
}
|
151 |
+
$orders[] = $order;
|
152 |
+
|
153 |
+
}
|
154 |
+
|
155 |
+
$this->getResponse()
|
156 |
+
->setBody(json_encode($orders))
|
157 |
+
->setHttpResponseCode(200)
|
158 |
+
->setHeader('Content-type', 'application/json', true);
|
159 |
+
return $this;
|
160 |
+
}
|
161 |
+
}
|
@@ -8,6 +8,7 @@
|
|
8 |
//
|
9 |
// statsAction
|
10 |
// ordersAction
|
|
|
11 |
// customersAction
|
12 |
// categoriesAction
|
13 |
// productsAction
|
@@ -26,11 +27,14 @@
|
|
26 |
// installinfoAction
|
27 |
// rulesAction
|
28 |
// eavinfo_catalogAction
|
29 |
-
//
|
30 |
-
//
|
|
|
|
|
|
|
31 |
|
32 |
|
33 |
-
define("apiversion","1.
|
34 |
|
35 |
class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Action
|
36 |
{
|
@@ -80,7 +84,8 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
80 |
return true;
|
81 |
}
|
82 |
|
83 |
-
|
|
|
84 |
{
|
85 |
if(!$this->_authorise()) {
|
86 |
return $this;
|
@@ -92,6 +97,8 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
92 |
$sections = explode('/', trim($this->getRequest()->getPathInfo(), '/'));
|
93 |
$since = $this->getRequest()->getParam('since','ALL');
|
94 |
|
|
|
|
|
95 |
$_productCol = Mage::getModel('catalog/product')->getCollection();
|
96 |
if($since != 'ALL'){
|
97 |
$_productCol->addAttributeToFilter('updated_at', array('gteq' =>$since));
|
@@ -172,7 +179,7 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
172 |
return $this;
|
173 |
}
|
174 |
|
175 |
-
public function
|
176 |
{
|
177 |
if(!$this->_authorise()) {
|
178 |
return $this;
|
@@ -184,9 +191,7 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
184 |
$sections = explode('/', trim($this->getRequest()->getPathInfo(), '/'));
|
185 |
$since = $this->getRequest()->getParam('since','ALL');
|
186 |
|
187 |
-
// set to admin
|
188 |
-
|
189 |
-
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
|
190 |
|
191 |
$_productCol = Mage::getModel('catalog/product')->getCollection();
|
192 |
if($since != 'ALL'){
|
@@ -241,6 +246,7 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
241 |
$magentoVersion = Mage::getVersion();
|
242 |
$moduleversion = (String)Mage::getConfig()->getNode()->modules->MocoInsight_Mocoauto->version;
|
243 |
$phpversion = phpversion();
|
|
|
244 |
|
245 |
$stats = array(
|
246 |
'success' => 'true',
|
@@ -255,6 +261,7 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
255 |
'Cart and Coupon rules' => $rulescount,
|
256 |
'System Date Time' => $currentSystemTime,
|
257 |
'Magento Version' => $magentoVersion,
|
|
|
258 |
'MocoAPI Version' => apiversion,
|
259 |
'Module Version' => $moduleversion,
|
260 |
'PHP Version' => $phpversion,
|
@@ -268,7 +275,6 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
268 |
return $this;
|
269 |
}
|
270 |
|
271 |
-
|
272 |
public function logstatsAction() // Return the number size of logs
|
273 |
{
|
274 |
if(!$this->_authorise()) {
|
@@ -363,8 +369,27 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
363 |
return $this;
|
364 |
}
|
365 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
366 |
|
367 |
-
public function
|
368 |
{
|
369 |
if(!$this->_authorise()) {
|
370 |
return $this;
|
@@ -379,7 +404,6 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
379 |
|
380 |
$_orderCol = Mage::getModel('sales/order')->getCollection()->addAttributeToSelect('*');
|
381 |
|
382 |
-
|
383 |
if($since != 'ALL'){
|
384 |
$_orderCol->addAttributeToFilter('updated_at', array('gteq' =>$since));
|
385 |
}
|
@@ -392,28 +416,20 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
392 |
$_orderCol->getSelect()->limit($page_size, ($offset * $page_size))->order('updated_at');
|
393 |
}
|
394 |
|
395 |
-
//Mage::log('SQL Query: '.$_orderCol->getSelect());
|
396 |
-
|
397 |
-
|
398 |
$orders = array();
|
399 |
|
400 |
foreach($_orderCol as $_order) {
|
|
|
|
|
401 |
|
402 |
try{
|
403 |
-
$order = array();
|
404 |
$order['moco_start_of_order_record'] = 'True';
|
405 |
$orderdetails = array();
|
406 |
$orderdetails = $_order->toArray();
|
|
|
407 |
foreach ($orderdetails as $key => $value) {
|
408 |
$order[$key] = $value;
|
409 |
}
|
410 |
-
$order['payment_method'] = $_order->getPayment()->getMethodInstance()->getTitle();
|
411 |
-
|
412 |
-
// Removing Tax Class as the customer really wanted VAT number
|
413 |
-
// $_quote = Mage::getModel('sales/quote')->load($_order->getQuoteId());
|
414 |
-
// $taxClassId = $_quote->getCustomerTaxClassId();
|
415 |
-
// $_taxClass = Mage::getModel('tax/class')->load($taxClassId);
|
416 |
-
// $order['moco_customer_tax_class'] = $_taxClass->getClassName();
|
417 |
|
418 |
if(is_object($_order->getBillingAddress())){
|
419 |
$_billing_address = $_order->getBillingAddress();
|
@@ -437,14 +453,12 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
437 |
}
|
438 |
$order['moco_tls'] = $orderitems;
|
439 |
|
440 |
-
|
441 |
$order['moco_end_of_order_record'] = 'True';
|
442 |
}
|
443 |
catch (Exception $e) {
|
444 |
$order['mocoauto_api_error'] = 'order record: ' . $e->getMessage();
|
445 |
}
|
446 |
$orders[] = $order;
|
447 |
-
|
448 |
}
|
449 |
|
450 |
$this->getResponse()
|
@@ -499,6 +513,96 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
499 |
return $this;
|
500 |
}
|
501 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
502 |
|
503 |
public function eavinfo_catalogAction()
|
504 |
{
|
@@ -520,7 +624,7 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
520 |
return $this;
|
521 |
}
|
522 |
|
523 |
-
public function
|
524 |
{
|
525 |
if(!$this->_authorise()) {
|
526 |
return $this;
|
@@ -541,7 +645,7 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
541 |
}
|
542 |
|
543 |
|
544 |
-
public function
|
545 |
{
|
546 |
$tablename = 'eav_entity_type'; // Set the table name here
|
547 |
|
@@ -572,6 +676,27 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
572 |
return $this;
|
573 |
}
|
574 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
575 |
public function customersAction()
|
576 |
{
|
577 |
if(!$this->_authorise()) {
|
@@ -716,7 +841,7 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
716 |
}
|
717 |
|
718 |
|
719 |
-
public function
|
720 |
{
|
721 |
if(!$this->_authorise()) {
|
722 |
return $this;
|
@@ -850,6 +975,28 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
850 |
return $this;
|
851 |
}
|
852 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
853 |
public function productsAction()
|
854 |
{
|
855 |
if(!$this->_authorise()) {
|
@@ -1182,7 +1329,7 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
1182 |
->setHeader('Content-type', 'application/json', true);
|
1183 |
return $this;
|
1184 |
}
|
1185 |
-
public function
|
1186 |
{
|
1187 |
$tablename1 = 'log_url';
|
1188 |
$tablename2 = 'log_url_info';
|
@@ -1381,7 +1528,7 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
1381 |
return $this;
|
1382 |
}
|
1383 |
|
1384 |
-
public function
|
1385 |
{
|
1386 |
if(!$this->_authorise()) {
|
1387 |
return $this;
|
@@ -1504,19 +1651,28 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
1504 |
|
1505 |
$_cartsCol = Mage::getResourceModel('sales/quote_collection')->addFieldToFilter('is_active', '1'); // 1 = quote has not been conveted to an order
|
1506 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1507 |
|
1508 |
-
$
|
|
|
1509 |
array(
|
1510 |
'customer_id', //attribute_1 with key 0
|
1511 |
'customer_email', //attribute_2 with key 1
|
1512 |
),
|
1513 |
array(
|
1514 |
-
// array('neq'=>null), //condition for attribute_1 with key 0
|
1515 |
-
// array('neq'=>null), //condition for attribute_2
|
1516 |
array('notnull'=>1), // This form creates a NOT NULL query.
|
1517 |
array('notnull'=>1),
|
1518 |
)
|
1519 |
);
|
|
|
1520 |
|
1521 |
$_cartsCol->getSelect()->limit($page_size, ($offset * $page_size))->order('updated_at');
|
1522 |
|
@@ -1537,24 +1693,62 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
1537 |
|
1538 |
|
1539 |
foreach($_cartsCol as $_cart) {
|
|
|
|
|
1540 |
try {
|
1541 |
-
$
|
1542 |
-
$
|
1543 |
-
$_cartItemsCol = $_cart -> getItemsCollection();
|
1544 |
|
1545 |
-
|
1546 |
-
$
|
1547 |
-
$
|
1548 |
-
$carts[] = array('product_qty' => $_cartitem->getQty());
|
1549 |
-
$carts[] = array('updated_at' => $_cartitem->getUpdatedAt());
|
1550 |
-
$carts[] = array('product_type' => $_cartitem->getProductType());
|
1551 |
-
//$carts[] = $_cartitem->toArray();
|
1552 |
}
|
1553 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1554 |
}
|
1555 |
catch(Exception $e) {
|
1556 |
-
|
1557 |
}
|
|
|
|
|
|
|
1558 |
}
|
1559 |
|
1560 |
$this->getResponse()
|
@@ -1564,7 +1758,7 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
1564 |
return $this;
|
1565 |
}
|
1566 |
|
1567 |
-
public function
|
1568 |
{
|
1569 |
if(!$this->_authorise()) {
|
1570 |
return $this;
|
@@ -1631,6 +1825,65 @@ class MocoInsight_Mocoauto_ApiController extends Mage_Core_Controller_Front_Acti
|
|
1631 |
|
1632 |
$sections = explode('/', trim($this->getRequest()->getPathInfo(), '/'));
|
1633 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1634 |
$offset = $this->getRequest()->getParam('offset', 0);
|
1635 |
$page_size = $this->getRequest()->getParam('page_size', 20);
|
1636 |
$since = $this->getRequest()->getParam('since', 'ALL');
|
8 |
//
|
9 |
// statsAction
|
10 |
// ordersAction
|
11 |
+
// ordersNoPaymentAction for trollweb Norwegan clients.
|
12 |
// customersAction
|
13 |
// categoriesAction
|
14 |
// productsAction
|
27 |
// installinfoAction
|
28 |
// rulesAction
|
29 |
// eavinfo_catalogAction
|
30 |
+
// attrinfoAction
|
31 |
+
// entitytypeinfoAction
|
32 |
+
// order_idsAction
|
33 |
+
// customer_idsAction
|
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 |
{
|
84 |
return true;
|
85 |
}
|
86 |
|
87 |
+
|
88 |
+
public function statsAction()
|
89 |
{
|
90 |
if(!$this->_authorise()) {
|
91 |
return $this;
|
97 |
$sections = explode('/', trim($this->getRequest()->getPathInfo(), '/'));
|
98 |
$since = $this->getRequest()->getParam('since','ALL');
|
99 |
|
100 |
+
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); // set to admin view all sites and stores
|
101 |
+
|
102 |
$_productCol = Mage::getModel('catalog/product')->getCollection();
|
103 |
if($since != 'ALL'){
|
104 |
$_productCol->addAttributeToFilter('updated_at', array('gteq' =>$since));
|
179 |
return $this;
|
180 |
}
|
181 |
|
182 |
+
public function test_statsAction() // test adding edition info
|
183 |
{
|
184 |
if(!$this->_authorise()) {
|
185 |
return $this;
|
191 |
$sections = explode('/', trim($this->getRequest()->getPathInfo(), '/'));
|
192 |
$since = $this->getRequest()->getParam('since','ALL');
|
193 |
|
194 |
+
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); // set to admin view all sites and stores
|
|
|
|
|
195 |
|
196 |
$_productCol = Mage::getModel('catalog/product')->getCollection();
|
197 |
if($since != 'ALL'){
|
246 |
$magentoVersion = Mage::getVersion();
|
247 |
$moduleversion = (String)Mage::getConfig()->getNode()->modules->MocoInsight_Mocoauto->version;
|
248 |
$phpversion = phpversion();
|
249 |
+
$magentoedition = (String)Mage::getEdition();
|
250 |
|
251 |
$stats = array(
|
252 |
'success' => 'true',
|
261 |
'Cart and Coupon rules' => $rulescount,
|
262 |
'System Date Time' => $currentSystemTime,
|
263 |
'Magento Version' => $magentoVersion,
|
264 |
+
'Magento Edition' => $magentoedition,
|
265 |
'MocoAPI Version' => apiversion,
|
266 |
'Module Version' => $moduleversion,
|
267 |
'PHP Version' => $phpversion,
|
275 |
return $this;
|
276 |
}
|
277 |
|
|
|
278 |
public function logstatsAction() // Return the number size of logs
|
279 |
{
|
280 |
if(!$this->_authorise()) {
|
369 |
return $this;
|
370 |
}
|
371 |
|
372 |
+
public function order_idsAction()
|
373 |
+
{
|
374 |
+
if(!$this->_authorise()) {
|
375 |
+
return $this;
|
376 |
+
}
|
377 |
+
|
378 |
+
$sections = explode('/', trim($this->getRequest()->getPathInfo(), '/'));
|
379 |
+
|
380 |
+
$offset = $this->getRequest()->getParam('offset', 0);
|
381 |
+
$page_size = $this->getRequest()->getParam('page_size', 20);
|
382 |
+
|
383 |
+
$orderIds = Mage::getModel('sales/order')->getCollection()->getAllIds($limit= $page_size, $offset =($offset * $page_size));
|
384 |
+
|
385 |
+
$this->getResponse()
|
386 |
+
->setBody(json_encode($orderIds))
|
387 |
+
->setHttpResponseCode(200)
|
388 |
+
->setHeader('Content-type', 'application/json', true);
|
389 |
+
return $this;
|
390 |
+
}
|
391 |
|
392 |
+
public function ordersNoPaymentAction() // Made for Trollweb customer testing.
|
393 |
{
|
394 |
if(!$this->_authorise()) {
|
395 |
return $this;
|
404 |
|
405 |
$_orderCol = Mage::getModel('sales/order')->getCollection()->addAttributeToSelect('*');
|
406 |
|
|
|
407 |
if($since != 'ALL'){
|
408 |
$_orderCol->addAttributeToFilter('updated_at', array('gteq' =>$since));
|
409 |
}
|
416 |
$_orderCol->getSelect()->limit($page_size, ($offset * $page_size))->order('updated_at');
|
417 |
}
|
418 |
|
|
|
|
|
|
|
419 |
$orders = array();
|
420 |
|
421 |
foreach($_orderCol as $_order) {
|
422 |
+
|
423 |
+
$order = array();
|
424 |
|
425 |
try{
|
|
|
426 |
$order['moco_start_of_order_record'] = 'True';
|
427 |
$orderdetails = array();
|
428 |
$orderdetails = $_order->toArray();
|
429 |
+
|
430 |
foreach ($orderdetails as $key => $value) {
|
431 |
$order[$key] = $value;
|
432 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
433 |
|
434 |
if(is_object($_order->getBillingAddress())){
|
435 |
$_billing_address = $_order->getBillingAddress();
|
453 |
}
|
454 |
$order['moco_tls'] = $orderitems;
|
455 |
|
|
|
456 |
$order['moco_end_of_order_record'] = 'True';
|
457 |
}
|
458 |
catch (Exception $e) {
|
459 |
$order['mocoauto_api_error'] = 'order record: ' . $e->getMessage();
|
460 |
}
|
461 |
$orders[] = $order;
|
|
|
462 |
}
|
463 |
|
464 |
$this->getResponse()
|
513 |
return $this;
|
514 |
}
|
515 |
|
516 |
+
public function ordersAction()
|
517 |
+
{
|
518 |
+
if(!$this->_authorise()) {
|
519 |
+
return $this;
|
520 |
+
}
|
521 |
+
|
522 |
+
$sections = explode('/', trim($this->getRequest()->getPathInfo(), '/'));
|
523 |
+
|
524 |
+
$offset = $this->getRequest()->getParam('offset', 0);
|
525 |
+
$page_size = $this->getRequest()->getParam('page_size', 20);
|
526 |
+
$since = $this->getRequest()->getParam('since','ALL');
|
527 |
+
$gTE = $this->getRequest()->getParam('gte', 'ALL');
|
528 |
+
|
529 |
+
$_orderCol = Mage::getModel('sales/order')->getCollection()->addAttributeToSelect('*');
|
530 |
+
|
531 |
+
|
532 |
+
if($since != 'ALL'){
|
533 |
+
$_orderCol->addAttributeToFilter('updated_at', array('gteq' =>$since));
|
534 |
+
}
|
535 |
+
|
536 |
+
if($gTE != 'ALL'){
|
537 |
+
$_orderCol->addFieldToFilter('entity_id', array('gteq' =>$gTE));
|
538 |
+
$_orderCol->getSelect()->limit($page_size, ($offset * $page_size))->order('entity_id');
|
539 |
+
}
|
540 |
+
else{
|
541 |
+
$_orderCol->getSelect()->limit($page_size, ($offset * $page_size))->order('updated_at');
|
542 |
+
}
|
543 |
+
|
544 |
+
//Mage::log('SQL Query: '.$_orderCol->getSelect());
|
545 |
+
|
546 |
+
|
547 |
+
$orders = array();
|
548 |
+
|
549 |
+
foreach($_orderCol as $_order) {
|
550 |
+
|
551 |
+
$order = array();
|
552 |
+
|
553 |
+
try{
|
554 |
+
$order['moco_start_of_order_record'] = 'True';
|
555 |
+
$orderdetails = array();
|
556 |
+
$orderdetails = $_order->toArray();
|
557 |
+
foreach ($orderdetails as $key => $value) {
|
558 |
+
$order[$key] = $value;
|
559 |
+
}
|
560 |
+
if(is_object($_order->getPayment()) && method_exists($_order->getPayment()->getMethodInstance(), 'getTitle')){
|
561 |
+
$order['payment_method'] = $_order->getPayment()->getMethodInstance()->getTitle();
|
562 |
+
}
|
563 |
+
else{
|
564 |
+
$order['payment_method'] = 'Unable to get payment_method';
|
565 |
+
}
|
566 |
+
|
567 |
+
if(is_object($_order->getBillingAddress())){
|
568 |
+
$_billing_address = $_order->getBillingAddress();
|
569 |
+
$billaddrdetails = array();
|
570 |
+
$billaddrdetails[] = $_billing_address->toArray();
|
571 |
+
$order['moco_address'] = $billaddrdetails;
|
572 |
+
}
|
573 |
+
|
574 |
+
if(is_object($_order->getShippingAddress())){
|
575 |
+
|
576 |
+
$_shipping_address = $_order->getShippingAddress();
|
577 |
+
$shipaddrdetails = array();
|
578 |
+
$shipaddrdetails[] = $_shipping_address->toArray();
|
579 |
+
$order['moco_ship_address'] = $shipaddrdetails;
|
580 |
+
}
|
581 |
+
|
582 |
+
$_orderItemsCol = $_order->getItemsCollection();
|
583 |
+
$orderitems = array();
|
584 |
+
foreach($_orderItemsCol as $_orderitem){
|
585 |
+
$orderitems[] = $_orderitem->toArray();
|
586 |
+
}
|
587 |
+
$order['moco_tls'] = $orderitems;
|
588 |
+
|
589 |
+
|
590 |
+
$order['moco_end_of_order_record'] = 'True';
|
591 |
+
}
|
592 |
+
catch (Exception $e) {
|
593 |
+
$order['mocoauto_api_error'] = 'order record: ' . $e->getMessage();
|
594 |
+
}
|
595 |
+
$orders[] = $order;
|
596 |
+
|
597 |
+
}
|
598 |
+
|
599 |
+
$this->getResponse()
|
600 |
+
->setBody(json_encode($orders))
|
601 |
+
->setHttpResponseCode(200)
|
602 |
+
->setHeader('Content-type', 'application/json', true);
|
603 |
+
return $this;
|
604 |
+
}
|
605 |
+
|
606 |
|
607 |
public function eavinfo_catalogAction()
|
608 |
{
|
624 |
return $this;
|
625 |
}
|
626 |
|
627 |
+
public function attrinfoAction()
|
628 |
{
|
629 |
if(!$this->_authorise()) {
|
630 |
return $this;
|
645 |
}
|
646 |
|
647 |
|
648 |
+
public function entitytypeinfoAction()
|
649 |
{
|
650 |
$tablename = 'eav_entity_type'; // Set the table name here
|
651 |
|
676 |
return $this;
|
677 |
}
|
678 |
|
679 |
+
public function customer_idsAction()
|
680 |
+
{
|
681 |
+
if(!$this->_authorise()) {
|
682 |
+
return $this;
|
683 |
+
}
|
684 |
+
|
685 |
+
$sections = explode('/', trim($this->getRequest()->getPathInfo(), '/'));
|
686 |
+
|
687 |
+
$offset = $this->getRequest()->getParam('offset', 0);
|
688 |
+
$page_size = $this->getRequest()->getParam('page_size', 20);
|
689 |
+
|
690 |
+
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
|
691 |
+
$customerIds = Mage::getModel('customer/customer')->getCollection()->getAllIds($limit= $page_size, $offset =($offset * $page_size));
|
692 |
+
|
693 |
+
$this->getResponse()
|
694 |
+
->setBody(json_encode($customerIds))
|
695 |
+
->setHttpResponseCode(200)
|
696 |
+
->setHeader('Content-type', 'application/json', true);
|
697 |
+
return $this;
|
698 |
+
}
|
699 |
+
|
700 |
public function customersAction()
|
701 |
{
|
702 |
if(!$this->_authorise()) {
|
841 |
}
|
842 |
|
843 |
|
844 |
+
public function ex_productsAction()
|
845 |
{
|
846 |
if(!$this->_authorise()) {
|
847 |
return $this;
|
975 |
return $this;
|
976 |
}
|
977 |
|
978 |
+
public function product_idsAction()
|
979 |
+
{
|
980 |
+
if(!$this->_authorise()) {
|
981 |
+
return $this;
|
982 |
+
}
|
983 |
+
|
984 |
+
$sections = explode('/', trim($this->getRequest()->getPathInfo(), '/'));
|
985 |
+
|
986 |
+
$offset = $this->getRequest()->getParam('offset', 0);
|
987 |
+
$page_size = $this->getRequest()->getParam('page_size', 20);
|
988 |
+
|
989 |
+
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
|
990 |
+
$productIds = Mage::getModel('catalog/product')->getCollection()->getAllIds($limit= $page_size, $offset =($offset * $page_size));
|
991 |
+
|
992 |
+
$this->getResponse()
|
993 |
+
->setBody(json_encode($productIds))
|
994 |
+
->setHttpResponseCode(200)
|
995 |
+
->setHeader('Content-type', 'application/json', true);
|
996 |
+
return $this;
|
997 |
+
}
|
998 |
+
|
999 |
+
|
1000 |
public function productsAction()
|
1001 |
{
|
1002 |
if(!$this->_authorise()) {
|
1329 |
->setHeader('Content-type', 'application/json', true);
|
1330 |
return $this;
|
1331 |
}
|
1332 |
+
public function ex_log_all_joinedAction()
|
1333 |
{
|
1334 |
$tablename1 = 'log_url';
|
1335 |
$tablename2 = 'log_url_info';
|
1528 |
return $this;
|
1529 |
}
|
1530 |
|
1531 |
+
public function ex_subscribersAction()
|
1532 |
{
|
1533 |
if(!$this->_authorise()) {
|
1534 |
return $this;
|
1651 |
|
1652 |
$_cartsCol = Mage::getResourceModel('sales/quote_collection')->addFieldToFilter('is_active', '1'); // 1 = quote has not been conveted to an order
|
1653 |
|
1654 |
+
$magentoVersion = Mage::getVersion();
|
1655 |
+
if (version_compare($magentoVersion, '1.7', '>=')){
|
1656 |
+
//Mage::log("Version is above check");
|
1657 |
+
$aboveVersion17Flag = 1;
|
1658 |
+
}
|
1659 |
+
else {
|
1660 |
+
//Mage::log("Version is below check");
|
1661 |
+
$aboveVersion17Flag = 0;
|
1662 |
+
}
|
1663 |
|
1664 |
+
if($aboveVersion17Flag){ // This will only work with Magento > 1.6
|
1665 |
+
$_cartsCol->addFieldToFilter( // If there is no email or customer id we dont want the cart.
|
1666 |
array(
|
1667 |
'customer_id', //attribute_1 with key 0
|
1668 |
'customer_email', //attribute_2 with key 1
|
1669 |
),
|
1670 |
array(
|
|
|
|
|
1671 |
array('notnull'=>1), // This form creates a NOT NULL query.
|
1672 |
array('notnull'=>1),
|
1673 |
)
|
1674 |
);
|
1675 |
+
}
|
1676 |
|
1677 |
$_cartsCol->getSelect()->limit($page_size, ($offset * $page_size))->order('updated_at');
|
1678 |
|
1693 |
|
1694 |
|
1695 |
foreach($_cartsCol as $_cart) {
|
1696 |
+
$cart = array();
|
1697 |
+
|
1698 |
try {
|
1699 |
+
$cart['moco_start_of_cart_record'] = 'True';
|
1700 |
+
$cartdetails = array();
|
|
|
1701 |
|
1702 |
+
if(!$aboveVersion17Flag && !$_cart->getCustomerId() && !$_cart->getCustomerEmail()){
|
1703 |
+
//Mage::log($_cart->getEntityId() . " " . $_cart->getCustomerEmail() . " " . $_cart->getCustomerId());
|
1704 |
+
$cart['moco_no_cart_identification_information'] = 'True';
|
|
|
|
|
|
|
|
|
1705 |
}
|
1706 |
+
else{
|
1707 |
+
$cartdetails = $_cart->toArray();
|
1708 |
+
|
1709 |
+
foreach ($cartdetails as $key =>$value){
|
1710 |
+
$cart[$key] = $value;
|
1711 |
+
}
|
1712 |
+
|
1713 |
+
$_cartItemsCol = $_cart -> getItemsCollection();
|
1714 |
+
$cartitems = array();
|
1715 |
+
|
1716 |
+
foreach($_cartItemsCol as $_cartitem){
|
1717 |
+
$cartitem = array();
|
1718 |
+
try{
|
1719 |
+
$cartitem['item_id'] = $_cartitem->getItemId();
|
1720 |
+
$cartitem['parent_id'] = $_cartitem->getParentId();
|
1721 |
+
$cartitem['product_id'] = $_cartitem->getProductId();
|
1722 |
+
$cartitem['product_sku'] = $_cartitem->getSku();
|
1723 |
+
$cartitem['product_qty'] = $_cartitem->getQty();
|
1724 |
+
$cartitem['updated_at'] = $_cartitem->getUpdatedAt();
|
1725 |
+
$cartitem['product_name'] = $_cartitem->getName();
|
1726 |
+
$cartitem['product_type'] = $_cartitem->getProductType();
|
1727 |
+
$cartitem['base_price'] = $_cartitem->getBasePrice();
|
1728 |
+
$cartitem['base_tax_amount'] = $_cartitem->getBaseTaxAmount();
|
1729 |
+
$cartitem['base_discount_amount'] = $_cartitem->getBaseDiscountAmount();
|
1730 |
+
$cartitem['base_cost'] = $_cartitem->getBaseCost();
|
1731 |
+
$cartitem['base_price_incl_tax'] = $_cartitem->getBasePriceInclTax();
|
1732 |
+
}
|
1733 |
+
catch(Exception $e) {
|
1734 |
+
$cartitem['mocoauto_api_error'] = 'moco_unable_to_read_cartitem: ' . $e->getMessage();
|
1735 |
+
}
|
1736 |
+
|
1737 |
+
$cartitems[] = $cartitem;
|
1738 |
+
}
|
1739 |
+
|
1740 |
+
$cart['moco_cart_items'] = $cartitems;
|
1741 |
+
}
|
1742 |
+
|
1743 |
+
$cart['moco_end_of_cart_record'] = 'True';
|
1744 |
+
|
1745 |
}
|
1746 |
catch(Exception $e) {
|
1747 |
+
$cart['mocoauto_api_error'] = 'moco_unable_to_read_cart: ' . $e->getMessage();
|
1748 |
}
|
1749 |
+
|
1750 |
+
$carts[] = $cart;
|
1751 |
+
|
1752 |
}
|
1753 |
|
1754 |
$this->getResponse()
|
1758 |
return $this;
|
1759 |
}
|
1760 |
|
1761 |
+
public function ex_unconvertedcartsAction()//This query returns only no empty carts when no dat filter applied
|
1762 |
{
|
1763 |
if(!$this->_authorise()) {
|
1764 |
return $this;
|
1825 |
|
1826 |
$sections = explode('/', trim($this->getRequest()->getPathInfo(), '/'));
|
1827 |
|
1828 |
+
$offset = $this->getRequest()->getParam('offset', 0);
|
1829 |
+
$page_size = $this->getRequest()->getParam('page_size', 20);
|
1830 |
+
$since = $this->getRequest()->getParam('since', 'ALL');
|
1831 |
+
$gTE = $this->getRequest()->getParam('gte', 'ALL');
|
1832 |
+
|
1833 |
+
$_wishlistCol = Mage::getModel('wishlist/wishlist')-> getCollection();
|
1834 |
+
|
1835 |
+
if($since != 'ALL'){
|
1836 |
+
$_wishlistCol->addFieldToFilter('updated_at', array('gteq' =>$since));
|
1837 |
+
}
|
1838 |
+
|
1839 |
+
if($gTE != 'ALL'){
|
1840 |
+
$_wishlistCol->addFieldToFilter('wishlist_id', array('gteq' =>$gTE));
|
1841 |
+
$_wishlistCol->getSelect()->limit($page_size, ($offset * $page_size))->order('wishlist_id');
|
1842 |
+
}
|
1843 |
+
else{
|
1844 |
+
$_wishlistCol->getSelect()->limit($page_size, ($offset * $page_size))->order('updated_at');
|
1845 |
+
}
|
1846 |
+
|
1847 |
+
$wishlists = array();
|
1848 |
+
|
1849 |
+
foreach($_wishlistCol as $_wishlist) {
|
1850 |
+
$wishlist = array();
|
1851 |
+
$wishlist['moco_start_of_wishlist_record'] = 'True';
|
1852 |
+
$wishlist['wishlist_id'] = $_wishlist->getId();
|
1853 |
+
$wishlist['customer_id'] = $_wishlist->getCustomerId();
|
1854 |
+
$wishlist['updated_at'] = $_wishlist->getUpdatedAt();
|
1855 |
+
$_wishlistitemsCol = $_wishlist->getItemCollection();
|
1856 |
+
$wishlistitems = array();
|
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();
|
1863 |
+
$wishlistitem['added_at'] = $_wishlistitem->getAddedAt();
|
1864 |
+
$wishlistitems[] = $wishlistitem;
|
1865 |
+
}
|
1866 |
+
|
1867 |
+
$wishlist['wish_list_items'] = $wishlistitems;
|
1868 |
+
$wishlist['moco_end_of_wishlist_record'] = 'True';
|
1869 |
+
$wishlists[] = $wishlist;
|
1870 |
+
}
|
1871 |
+
|
1872 |
+
$this->getResponse()
|
1873 |
+
->setBody(json_encode($wishlists))
|
1874 |
+
->setHttpResponseCode(200)
|
1875 |
+
->setHeader('Content-type', 'application/json', true);
|
1876 |
+
return $this;
|
1877 |
+
}
|
1878 |
+
|
1879 |
+
public function ex_wishlistsAction()
|
1880 |
+
{
|
1881 |
+
if(!$this->_authorise()) {
|
1882 |
+
return $this;
|
1883 |
+
}
|
1884 |
+
|
1885 |
+
$sections = explode('/', trim($this->getRequest()->getPathInfo(), '/'));
|
1886 |
+
|
1887 |
$offset = $this->getRequest()->getParam('offset', 0);
|
1888 |
$page_size = $this->getRequest()->getParam('page_size', 20);
|
1889 |
$since = $this->getRequest()->getParam('since', 'ALL');
|
@@ -4,7 +4,7 @@
|
|
4 |
<config>
|
5 |
<modules>
|
6 |
<MocoInsight_Mocoauto>
|
7 |
-
<version>1.
|
8 |
</MocoInsight_Mocoauto>
|
9 |
</modules>
|
10 |
<global>
|
4 |
<config>
|
5 |
<modules>
|
6 |
<MocoInsight_Mocoauto>
|
7 |
+
<version>1.5.0.2</version>
|
8 |
</MocoInsight_Mocoauto>
|
9 |
</modules>
|
10 |
<global>
|
@@ -4,7 +4,7 @@
|
|
4 |
<config>
|
5 |
<modules>
|
6 |
<MocoInsight_Mocoauto>
|
7 |
-
<version>1.
|
8 |
</MocoInsight_Mocoauto>
|
9 |
</modules>
|
10 |
<global>
|
4 |
<config>
|
5 |
<modules>
|
6 |
<MocoInsight_Mocoauto>
|
7 |
+
<version>1.4.9</version>
|
8 |
</MocoInsight_Mocoauto>
|
9 |
</modules>
|
10 |
<global>
|
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>MocoInsight_Mocoauto</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL v1.0.0</license>
|
7 |
<channel>community</channel>
|
@@ -11,7 +11,24 @@
|
|
11 |

|
12 |

|
13 |
</description>
|
14 |
-
<notes>1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |

|
16 |
Support for multiple web sites on single Magento instance.
|
17 |

|
@@ -170,9 +187,9 @@ System date/time
|
|
170 |
added success true for succesful requests
|
171 |
changed product category to moco_category</notes>
|
172 |
<authors><author><name>Rob Davies</name><user>mocoinsight</user><email>rob.davies@mocoinsight.com</email></author></authors>
|
173 |
-
<date>2014-
|
174 |
-
<time>
|
175 |
-
<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="ApiController.php" hash="
|
176 |
<compatible/>
|
177 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
178 |
</package>
|
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 |

|
12 |

|
13 |
</description>
|
14 |
+
<notes>1.5.0.2
|
15 |
+

|
16 |
+
Maintenance release.
|
17 |
+

|
18 |
+
1.5.0.0
|
19 |
+

|
20 |
+
OrdersNoPaymentAction for sites with non standard payment methods.
|
21 |
+

|
22 |
+
1.4.9
|
23 |
+

|
24 |
+
Exception handle for payment method.
|
25 |
+
Updated wishlistsAction
|
26 |
+
New product_IdsAction
|
27 |
+
New customer_IdsAction
|
28 |
+
New order_IdsAction
|
29 |
+
unconvertedcarts fix for Magento < 1.7
|
30 |
+

|
31 |
+
1.4.7
|
32 |

|
33 |
Support for multiple web sites on single Magento instance.
|
34 |

|
187 |
added success true for succesful requests
|
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>
|