Version Notes
Small fixes on orders sync process
Download this release
Release Info
Developer | Eduard G. Dumitrescu |
Extension | Intelivemetrics_Unityreports |
Version | 0.7.4 |
Comparing to | |
See all releases |
Code changes from version 0.7.3 to 0.7.4
- app/code/community/Intelivemetrics/Unityreports/Model/Cron/Sync.php +98 -31
- app/code/community/Intelivemetrics/Unityreports/Model/Request/Diagnose.php +1 -1
- app/code/community/Intelivemetrics/Unityreports/Model/Sync.php +60 -60
- app/code/community/Intelivemetrics/Unityreports/Model/Sync/Order.php +4 -3
- app/code/community/Intelivemetrics/Unityreports/etc/config.xml +2 -2
- package.xml +5 -5
app/code/community/Intelivemetrics/Unityreports/Model/Cron/Sync.php
CHANGED
@@ -12,69 +12,136 @@
|
|
12 |
class Intelivemetrics_Unityreports_Model_Cron_Sync
|
13 |
extends Intelivemetrics_Unityreports_Model_Cron{
|
14 |
|
|
|
15 |
/**
|
16 |
* Metodo invocato dal Cron di Magento (vedi xml di configurazione)
|
17 |
* @assert () == true
|
18 |
* @return null
|
19 |
*/
|
20 |
-
public function
|
21 |
$helper = Mage::helper('unityreports');
|
22 |
try {
|
|
|
23 |
//Check app status before syncing
|
24 |
-
if(!$this->_appIsOk()){
|
25 |
$helper->debug('App is not ok, cannot send data');
|
26 |
return false;
|
27 |
}
|
28 |
-
|
29 |
-
//
|
30 |
-
if (($
|
31 |
$helper->debug('OK syncing products');
|
32 |
-
return $res;
|
33 |
}
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
$helper->debug('OK syncing orders');
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
38 |
}
|
39 |
|
40 |
-
|
|
|
41 |
$helper->debug('OK syncing invoices');
|
42 |
-
return $res;
|
43 |
}
|
44 |
-
|
45 |
-
if (($res=Mage::getModel('unityreports/sync_creditnote')->runSync())!==Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
46 |
$helper->debug('OK syncing credit memos');
|
47 |
-
|
|
|
|
|
48 |
}
|
49 |
|
50 |
-
|
|
|
51 |
$helper->debug('OK syncing customers');
|
52 |
-
return $res;
|
53 |
}
|
54 |
-
|
55 |
-
if (($res=Mage::getModel('unityreports/sync_customerAction')->runSync())!==Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
56 |
$helper->debug('OK syncing customer actions');
|
57 |
-
return $res;
|
58 |
}
|
59 |
-
|
60 |
-
|
61 |
-
$helper->debug('OK syncing abcarts');
|
62 |
-
return $res;
|
63 |
-
}
|
64 |
-
|
65 |
-
if (($res=Mage::getModel('unityreports/sync_productVariation')->runSync())!==Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
66 |
-
$helper->debug('OK syncing product variations');
|
67 |
-
return $res;
|
68 |
}
|
69 |
-
|
70 |
} catch (Exception $e) {
|
71 |
$helper->debug($e, Zend_Log::ERR);
|
72 |
-
$helper->debug('FILE: ' . __FILE__.'LINE: ' . __LINE__);
|
73 |
return false;
|
74 |
}
|
75 |
-
|
76 |
return true;
|
77 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
}
|
80 |
|
12 |
class Intelivemetrics_Unityreports_Model_Cron_Sync
|
13 |
extends Intelivemetrics_Unityreports_Model_Cron{
|
14 |
|
15 |
+
|
16 |
/**
|
17 |
* Metodo invocato dal Cron di Magento (vedi xml di configurazione)
|
18 |
* @assert () == true
|
19 |
* @return null
|
20 |
*/
|
21 |
+
public function runSync() {
|
22 |
$helper = Mage::helper('unityreports');
|
23 |
try {
|
24 |
+
$helper->debug('*******NEW SYNC JOB START*******');
|
25 |
//Check app status before syncing
|
26 |
+
if (!$this->_appIsOk()) {
|
27 |
$helper->debug('App is not ok, cannot send data');
|
28 |
return false;
|
29 |
}
|
30 |
+
|
31 |
+
//sync prods & variations
|
32 |
+
if (($res1 = Mage::getModel('unityreports/sync_product')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
33 |
$helper->debug('OK syncing products');
|
|
|
34 |
}
|
35 |
+
if (($res2 = Mage::getModel('unityreports/sync_productVariation')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
36 |
+
$helper->debug('OK syncing product variations');
|
37 |
+
}
|
38 |
+
if ($res1 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC || $res2 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
39 |
+
return true;
|
40 |
+
}
|
41 |
+
|
42 |
+
//sync orders & abcarts
|
43 |
+
if (($res1 = Mage::getModel('unityreports/sync_order')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
44 |
$helper->debug('OK syncing orders');
|
45 |
+
}
|
46 |
+
if (($res2 = Mage::getModel('unityreports/sync_abcart')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
47 |
+
$helper->debug('OK syncing abcarts');
|
48 |
+
}
|
49 |
+
if ($res1 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC || $res2 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
50 |
+
return true;
|
51 |
}
|
52 |
|
53 |
+
//sync invoices & creditmemos
|
54 |
+
if (($res1 = Mage::getModel('unityreports/sync_invoice')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
55 |
$helper->debug('OK syncing invoices');
|
|
|
56 |
}
|
57 |
+
if (($res2 = Mage::getModel('unityreports/sync_creditnote')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
|
|
58 |
$helper->debug('OK syncing credit memos');
|
59 |
+
}
|
60 |
+
if ($res1 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC || $res2 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
61 |
+
return true;
|
62 |
}
|
63 |
|
64 |
+
//sync customers and customer actions
|
65 |
+
if (($res1 = Mage::getModel('unityreports/sync_customer')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
66 |
$helper->debug('OK syncing customers');
|
|
|
67 |
}
|
68 |
+
if (($res2 = Mage::getModel('unityreports/sync_customerAction')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
|
|
69 |
$helper->debug('OK syncing customer actions');
|
|
|
70 |
}
|
71 |
+
if ($res1 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC || $res2 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
72 |
+
return true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
}
|
|
|
74 |
} catch (Exception $e) {
|
75 |
$helper->debug($e, Zend_Log::ERR);
|
|
|
76 |
return false;
|
77 |
}
|
78 |
+
|
79 |
return true;
|
80 |
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Metodo invocato dal Cron di Magento (vedi xml di configurazione)
|
84 |
+
* @assert () == true
|
85 |
+
* @return null
|
86 |
+
*/
|
87 |
+
// public function sync() {
|
88 |
+
// $helper = Mage::helper('unityreports');
|
89 |
+
// try {
|
90 |
+
// //Check app status before syncing
|
91 |
+
// if(!$this->_appIsOk()){
|
92 |
+
// $helper->debug('App is not ok, cannot send data');
|
93 |
+
// return false;
|
94 |
+
// }
|
95 |
+
//
|
96 |
+
// //start syncing
|
97 |
+
// if (($res=Mage::getModel('unityreports/sync_product')->runSync())!==Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
98 |
+
// $helper->debug('OK syncing products');
|
99 |
+
// return $res;
|
100 |
+
// }
|
101 |
+
//
|
102 |
+
// if (($res=Mage::getModel('unityreports/sync_order')->runSync())!==Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
103 |
+
// $helper->debug('OK syncing orders');
|
104 |
+
// return $res;
|
105 |
+
// }
|
106 |
+
//
|
107 |
+
// if (($res=Mage::getModel('unityreports/sync_invoice')->runSync())!==Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
108 |
+
// $helper->debug('OK syncing invoices');
|
109 |
+
// return $res;
|
110 |
+
// }
|
111 |
+
//
|
112 |
+
// if (($res=Mage::getModel('unityreports/sync_creditnote')->runSync())!==Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
113 |
+
// $helper->debug('OK syncing credit memos');
|
114 |
+
// return $res;
|
115 |
+
// }
|
116 |
+
//
|
117 |
+
// if (($res=Mage::getModel('unityreports/sync_customer')->runSync())!==Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
118 |
+
// $helper->debug('OK syncing customers');
|
119 |
+
// return $res;
|
120 |
+
// }
|
121 |
+
//
|
122 |
+
// if (($res=Mage::getModel('unityreports/sync_customerAction')->runSync())!==Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
123 |
+
// $helper->debug('OK syncing customer actions');
|
124 |
+
// return $res;
|
125 |
+
// }
|
126 |
+
//
|
127 |
+
// if (($res=Mage::getModel('unityreports/sync_abcart')->runSync())!==Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
128 |
+
// $helper->debug('OK syncing abcarts');
|
129 |
+
// return $res;
|
130 |
+
// }
|
131 |
+
//
|
132 |
+
// if (($res=Mage::getModel('unityreports/sync_productVariation')->runSync())!==Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
133 |
+
// $helper->debug('OK syncing product variations');
|
134 |
+
// return $res;
|
135 |
+
// }
|
136 |
+
//
|
137 |
+
// } catch (Exception $e) {
|
138 |
+
// $helper->debug($e, Zend_Log::ERR);
|
139 |
+
// $helper->debug('FILE: ' . __FILE__.'LINE: ' . __LINE__);
|
140 |
+
// return false;
|
141 |
+
// }
|
142 |
+
//
|
143 |
+
// return true;
|
144 |
+
// }
|
145 |
|
146 |
}
|
147 |
|
app/code/community/Intelivemetrics/Unityreports/Model/Request/Diagnose.php
CHANGED
@@ -18,7 +18,7 @@ implements Intelivemetrics_Unityreports_Model_Request_Interface {
|
|
18 |
$syncStat = Mage::getModel('unityreports/admin_status_cron_sync')->toHtml();
|
19 |
$statStat = Mage::getModel('unityreports/admin_status_cron_stat')->toHtml();
|
20 |
$countStat = Mage::getModel('unityreports/admin_status_cron_count')->toHtml();
|
21 |
-
$globalStat = Mage::getModel('unityreports/
|
22 |
$mageStat = Mage::getModel('unityreports/admin_status_cron_mage')->toHtml();
|
23 |
|
24 |
$out="Sync: {$syncStat}
|
18 |
$syncStat = Mage::getModel('unityreports/admin_status_cron_sync')->toHtml();
|
19 |
$statStat = Mage::getModel('unityreports/admin_status_cron_stat')->toHtml();
|
20 |
$countStat = Mage::getModel('unityreports/admin_status_cron_count')->toHtml();
|
21 |
+
$globalStat = Mage::getModel('unityreports/admin_status_cron_globalCounters')->toHtml();
|
22 |
$mageStat = Mage::getModel('unityreports/admin_status_cron_mage')->toHtml();
|
23 |
|
24 |
$out="Sync: {$syncStat}
|
app/code/community/Intelivemetrics/Unityreports/Model/Sync.php
CHANGED
@@ -38,66 +38,66 @@ class Intelivemetrics_Unityreports_Model_Sync {
|
|
38 |
* @assert () == true
|
39 |
* @return null
|
40 |
*/
|
41 |
-
public function sync() {
|
42 |
-
$helper = Mage::helper('unityreports');
|
43 |
-
try {
|
44 |
-
$helper->debug('*******NEW SYNC JOB START*******');
|
45 |
-
//Check app status before syncing
|
46 |
-
if (!$this->_appIsOk()) {
|
47 |
-
$helper->debug('App is not ok, cannot send data');
|
48 |
-
return false;
|
49 |
-
}
|
50 |
-
|
51 |
-
//sync prods & variations
|
52 |
-
if (($res1 = Mage::getModel('unityreports/sync_product')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
53 |
-
$helper->debug('OK syncing products');
|
54 |
-
}
|
55 |
-
if (($res2 = Mage::getModel('unityreports/sync_productVariation')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
56 |
-
$helper->debug('OK syncing product variations');
|
57 |
-
}
|
58 |
-
if ($res1 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC || $res2 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
59 |
-
return true;
|
60 |
-
}
|
61 |
-
|
62 |
-
//sync orders & abcarts
|
63 |
-
if (($res1 = Mage::getModel('unityreports/sync_order')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
64 |
-
$helper->debug('OK syncing orders');
|
65 |
-
}
|
66 |
-
if (($res2 = Mage::getModel('unityreports/sync_abcart')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
67 |
-
$helper->debug('OK syncing abcarts');
|
68 |
-
}
|
69 |
-
if ($res1 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC || $res2 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
70 |
-
return true;
|
71 |
-
}
|
72 |
-
|
73 |
-
//sync invoices & creditmemos
|
74 |
-
if (($res1 = Mage::getModel('unityreports/sync_invoice')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
75 |
-
$helper->debug('OK syncing invoices');
|
76 |
-
}
|
77 |
-
if (($res2 = Mage::getModel('unityreports/sync_creditnote')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
78 |
-
$helper->debug('OK syncing credit memos');
|
79 |
-
}
|
80 |
-
if ($res1 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC || $res2 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
81 |
-
return true;
|
82 |
-
}
|
83 |
-
|
84 |
-
//sync customers and customer actions
|
85 |
-
if (($res1 = Mage::getModel('unityreports/sync_customer')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
86 |
-
$helper->debug('OK syncing customers');
|
87 |
-
}
|
88 |
-
if (($res2 = Mage::getModel('unityreports/sync_customerAction')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
89 |
-
$helper->debug('OK syncing customer actions');
|
90 |
-
}
|
91 |
-
if ($res1 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC || $res2 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
92 |
-
return true;
|
93 |
-
}
|
94 |
-
} catch (Exception $e) {
|
95 |
-
$helper->debug($e, Zend_Log::ERR);
|
96 |
-
return false;
|
97 |
-
}
|
98 |
-
|
99 |
-
return true;
|
100 |
-
}
|
101 |
|
102 |
protected function _getEntityType() {
|
103 |
$class = get_called_class();
|
38 |
* @assert () == true
|
39 |
* @return null
|
40 |
*/
|
41 |
+
// public function sync() {
|
42 |
+
// $helper = Mage::helper('unityreports');
|
43 |
+
// try {
|
44 |
+
// $helper->debug('*******NEW SYNC JOB START*******');
|
45 |
+
// //Check app status before syncing
|
46 |
+
// if (!$this->_appIsOk()) {
|
47 |
+
// $helper->debug('App is not ok, cannot send data');
|
48 |
+
// return false;
|
49 |
+
// }
|
50 |
+
//
|
51 |
+
// //sync prods & variations
|
52 |
+
// if (($res1 = Mage::getModel('unityreports/sync_product')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
53 |
+
// $helper->debug('OK syncing products');
|
54 |
+
// }
|
55 |
+
// if (($res2 = Mage::getModel('unityreports/sync_productVariation')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
56 |
+
// $helper->debug('OK syncing product variations');
|
57 |
+
// }
|
58 |
+
// if ($res1 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC || $res2 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
59 |
+
// return true;
|
60 |
+
// }
|
61 |
+
//
|
62 |
+
// //sync orders & abcarts
|
63 |
+
// if (($res1 = Mage::getModel('unityreports/sync_order')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
64 |
+
// $helper->debug('OK syncing orders');
|
65 |
+
// }
|
66 |
+
// if (($res2 = Mage::getModel('unityreports/sync_abcart')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
67 |
+
// $helper->debug('OK syncing abcarts');
|
68 |
+
// }
|
69 |
+
// if ($res1 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC || $res2 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
70 |
+
// return true;
|
71 |
+
// }
|
72 |
+
//
|
73 |
+
// //sync invoices & creditmemos
|
74 |
+
// if (($res1 = Mage::getModel('unityreports/sync_invoice')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
75 |
+
// $helper->debug('OK syncing invoices');
|
76 |
+
// }
|
77 |
+
// if (($res2 = Mage::getModel('unityreports/sync_creditnote')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
78 |
+
// $helper->debug('OK syncing credit memos');
|
79 |
+
// }
|
80 |
+
// if ($res1 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC || $res2 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
81 |
+
// return true;
|
82 |
+
// }
|
83 |
+
//
|
84 |
+
// //sync customers and customer actions
|
85 |
+
// if (($res1 = Mage::getModel('unityreports/sync_customer')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
86 |
+
// $helper->debug('OK syncing customers');
|
87 |
+
// }
|
88 |
+
// if (($res2 = Mage::getModel('unityreports/sync_customerAction')->runSync()) !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
89 |
+
// $helper->debug('OK syncing customer actions');
|
90 |
+
// }
|
91 |
+
// if ($res1 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC || $res2 !== Intelivemetrics_Unityreports_Model_Sync::NOTHING_TO_SYNC) {
|
92 |
+
// return true;
|
93 |
+
// }
|
94 |
+
// } catch (Exception $e) {
|
95 |
+
// $helper->debug($e, Zend_Log::ERR);
|
96 |
+
// return false;
|
97 |
+
// }
|
98 |
+
//
|
99 |
+
// return true;
|
100 |
+
// }
|
101 |
|
102 |
protected function _getEntityType() {
|
103 |
$class = get_called_class();
|
app/code/community/Intelivemetrics/Unityreports/Model/Sync/Order.php
CHANGED
@@ -103,8 +103,9 @@ class Intelivemetrics_Unityreports_Model_Sync_Order extends Intelivemetrics_Unit
|
|
103 |
$order_count = 0;
|
104 |
$category = Mage::getModel('catalog/category');
|
105 |
foreach ($collection as $order) {
|
|
|
|
|
106 |
try {
|
107 |
-
$attributes = $order->getData();
|
108 |
$currency = $attributes['order_currency_code'];
|
109 |
|
110 |
$order_fields = array(
|
@@ -132,7 +133,7 @@ class Intelivemetrics_Unityreports_Model_Sync_Order extends Intelivemetrics_Unit
|
|
132 |
'medium' => $attributes['medium'],
|
133 |
'content' => $attributes['content'],
|
134 |
'campaign' => $attributes['campaign'],
|
135 |
-
'payment_method' => $order->getPayment()->
|
136 |
);
|
137 |
|
138 |
// indirizzo di spedizione
|
@@ -182,7 +183,7 @@ class Intelivemetrics_Unityreports_Model_Sync_Order extends Intelivemetrics_Unit
|
|
182 |
|
183 |
//recupera path categorie, solo della prima categoria associata
|
184 |
//TODO: what if no category info is available? put some fake cateogry like UNKNOWN
|
185 |
-
if ($product = $item->getProduct()) {
|
186 |
$mainCategory = $product->getCategoryCollection()->getFirstItem();
|
187 |
$ids = array_reverse($mainCategory->getPathIds());
|
188 |
$counter = 1;
|
103 |
$order_count = 0;
|
104 |
$category = Mage::getModel('catalog/category');
|
105 |
foreach ($collection as $order) {
|
106 |
+
$attributes = $order->getData();
|
107 |
+
|
108 |
try {
|
|
|
109 |
$currency = $attributes['order_currency_code'];
|
110 |
|
111 |
$order_fields = array(
|
133 |
'medium' => $attributes['medium'],
|
134 |
'content' => $attributes['content'],
|
135 |
'campaign' => $attributes['campaign'],
|
136 |
+
'payment_method' => $order->getPayment()->getMethod()
|
137 |
);
|
138 |
|
139 |
// indirizzo di spedizione
|
183 |
|
184 |
//recupera path categorie, solo della prima categoria associata
|
185 |
//TODO: what if no category info is available? put some fake cateogry like UNKNOWN
|
186 |
+
if ( ($product = $item->getProduct()) || ($product=Mage::getModel('catalog/product')->load($item->getProductId())) ) {
|
187 |
$mainCategory = $product->getCategoryCollection()->getFirstItem();
|
188 |
$ids = array_reverse($mainCategory->getPathIds());
|
189 |
$counter = 1;
|
app/code/community/Intelivemetrics/Unityreports/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Intelivemetrics_Unityreports>
|
5 |
-
<version>0.7.
|
6 |
</Intelivemetrics_Unityreports>
|
7 |
</modules>
|
8 |
<global>
|
@@ -134,7 +134,7 @@
|
|
134 |
<cron_expr>*/5 * * * *</cron_expr>
|
135 |
</schedule>
|
136 |
<run>
|
137 |
-
<model>unityreports/cron_sync::
|
138 |
</run>
|
139 |
</unityreports_sync>
|
140 |
<unityreports_count>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Intelivemetrics_Unityreports>
|
5 |
+
<version>0.7.4</version>
|
6 |
</Intelivemetrics_Unityreports>
|
7 |
</modules>
|
8 |
<global>
|
134 |
<cron_expr>*/5 * * * *</cron_expr>
|
135 |
</schedule>
|
136 |
<run>
|
137 |
+
<model>unityreports/cron_sync::runSync</model>
|
138 |
</run>
|
139 |
</unityreports_sync>
|
140 |
<unityreports_count>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Intelivemetrics_Unityreports</name>
|
4 |
-
<version>0.7.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://choosealicense.com/licenses/apache-2.0/">APACHE</license>
|
7 |
<channel>community</channel>
|
@@ -10,11 +10,11 @@
|
|
10 |
<description>Unityreports brings powerful e-commerce analytics by combining Magento, Google Analytics and Google Adwords data.
|
11 |
http://www.unityreports.com
|
12 |
</description>
|
13 |
-
<notes>
|
14 |
<authors><author><name>Eduard G. Dumitrescu</name><user>bregoiu</user><email>eddie.dumitrescu@gmail.com</email></author></authors>
|
15 |
-
<date>2014-
|
16 |
-
<time>
|
17 |
-
<contents><target name="magecommunity"><dir name="Intelivemetrics"><dir name="Unityreports"><dir name="Block"><dir name="Adminhtml"><dir name="Button"><file name="Test.php" hash="f23e261d8cf7ef8314f121978b3b03d3"/></dir><dir name="Label"><file name="Renderer.php" hash="89a6ec5dddca5fcf86fbe85b83d87650"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="7fe1e1e75ce0aca62eedbe3962389943"/></dir><dir name="Model"><dir name="Admin"><dir name="Status"><file name="Active.php" hash="28d46ddb38425dcdddf34a694fcbcd84"/><dir name="Cron"><file name="Count.php" hash="8f8de0b781e5889c63b508dcba24532b"/><file name="GlobalCounters.php" hash="7b89f230d9a4fbd65bbf1dd87fd2d196"/><file name="Mage.php" hash="922159223ba73f6ecb4cb019595009f4"/><file name="Stat.php" hash="64e4b605214a0a966adada181d413d79"/><file name="Sync.php" hash="ab2313a6949823565001b9787a1a255a"/></dir><file name="Cron.php" hash="2f5e7a78dcdf1f593d239851316787cf"/></dir></dir><file name="Config.php" hash="590dd9e3939f58560d9b004763d48c05"/><dir name="Cron"><file name="Count.php" hash="e9fb746dabb7a9e2c8433f43fa723df8"/><file name="GlobalCounters.php" hash="c55ce27f8ea8c9a22b22053ae3715bff"/><file name="Request.php" hash="121bce122eb50f72e0d6d4c8a74d4900"/><file name="Sync.php" hash="
|
18 |
<compatible/>
|
19 |
<dependencies><required><php><min>5.1.0</min><max>7.0.0</max></php></required></dependencies>
|
20 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Intelivemetrics_Unityreports</name>
|
4 |
+
<version>0.7.4</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://choosealicense.com/licenses/apache-2.0/">APACHE</license>
|
7 |
<channel>community</channel>
|
10 |
<description>Unityreports brings powerful e-commerce analytics by combining Magento, Google Analytics and Google Adwords data.
|
11 |
http://www.unityreports.com
|
12 |
</description>
|
13 |
+
<notes>Small fixes on orders sync process</notes>
|
14 |
<authors><author><name>Eduard G. Dumitrescu</name><user>bregoiu</user><email>eddie.dumitrescu@gmail.com</email></author></authors>
|
15 |
+
<date>2014-12-05</date>
|
16 |
+
<time>08:28:16</time>
|
17 |
+
<contents><target name="magecommunity"><dir name="Intelivemetrics"><dir name="Unityreports"><dir name="Block"><dir name="Adminhtml"><dir name="Button"><file name="Test.php" hash="f23e261d8cf7ef8314f121978b3b03d3"/></dir><dir name="Label"><file name="Renderer.php" hash="89a6ec5dddca5fcf86fbe85b83d87650"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="7fe1e1e75ce0aca62eedbe3962389943"/></dir><dir name="Model"><dir name="Admin"><dir name="Status"><file name="Active.php" hash="28d46ddb38425dcdddf34a694fcbcd84"/><dir name="Cron"><file name="Count.php" hash="8f8de0b781e5889c63b508dcba24532b"/><file name="GlobalCounters.php" hash="7b89f230d9a4fbd65bbf1dd87fd2d196"/><file name="Mage.php" hash="922159223ba73f6ecb4cb019595009f4"/><file name="Stat.php" hash="64e4b605214a0a966adada181d413d79"/><file name="Sync.php" hash="ab2313a6949823565001b9787a1a255a"/></dir><file name="Cron.php" hash="2f5e7a78dcdf1f593d239851316787cf"/></dir></dir><file name="Config.php" hash="590dd9e3939f58560d9b004763d48c05"/><dir name="Cron"><file name="Count.php" hash="e9fb746dabb7a9e2c8433f43fa723df8"/><file name="GlobalCounters.php" hash="c55ce27f8ea8c9a22b22053ae3715bff"/><file name="Request.php" hash="121bce122eb50f72e0d6d4c8a74d4900"/><file name="Sync.php" hash="60494ad9531a6aea8f8e7550cbe13edd"/></dir><file name="Cron.php" hash="51f800a9c3c0ab0acdcda3aa9ba51104"/><file name="Customer.php" hash="c99b23d2ec6ffd8acdcc11cf7ed6421e"/><file name="Observer.php" hash="35631e64a3717973ee6f08b7b6410c70"/><dir name="Request"><file name="Base.php" hash="2c3fea1af836bedb205786d67465b97d"/><file name="Diagnose.php" hash="5e8525e5392c705660e800faf9b3e057"/><file name="GetCounters.php" hash="58350a26c70f552349a1eac4a29bb729"/><file name="HandShake.php" hash="8c1fb4cfef7fd9c7fb91ccc2c9503260"/><file name="Interface.php" hash="680707fa0a26ecd7237d116bc0b0a3da"/><file name="ResetAbcarts.php" hash="facdc1c2486398a2a62db126c8518174"/><file name="ResetAll.php" hash="b2533da935c5c66f741490f7f082c8df"/><file name="ResetCreditmemos.php" hash="a199f6f07c67e219d85990a3a08454cc"/><file name="ResetCustomers.php" hash="570aff03d862608cea5e09ded7e7fd9b"/><file name="ResetInvoices.php" hash="7c62cfe07c089b6ca64e32c9f4667297"/><file name="ResetOrders.php" hash="b73a88a0b1bd908c9e9e1d386f23087f"/><file name="ResetProductCounters.php" hash="e84ea87e8c2dcf28189e870c84118317"/><file name="ResetProducts.php" hash="9cfbc9b3f2a1388ef61f0af516ea8e02"/><file name="SetSpeed.php" hash="48496a1971c80fdaa689e0d65d0acd16"/><file name="StartSync.php" hash="30d94be6608c4bce5cebb114ad241fdb"/><file name="StopSync.php" hash="61fb6758c1600eed20c40e4ec28fcef1"/><file name="SyncResult.php" hash="c2f9893e2a083f9c792bc43a212196e4"/></dir><dir name="Resource"><dir name="Config"><file name="Collection.php" hash="dc7cc10daf7e597be061d7bf841d0f66"/></dir><file name="Config.php" hash="e3f733d66219ffc946a1b3cd5eca980d"/><file name="Setup.php" hash="2f7cb85c64bd6103faf9208c7d5f451f"/></dir><dir name="Sync"><file name="Abcart.php" hash="154afdc798017a7d9b041ba397e1b72b"/><file name="Creditnote.php" hash="6485779bff48de00a9ba0960c906cf9f"/><file name="Customer.php" hash="b49c41bf3a310a1b874f0498b4863af7"/><file name="CustomerAction.php" hash="160ace0a2e9fa8e28ce522f0d03db25d"/><file name="Interface.php" hash="d74a42d2d34c34ce8ec3379bb220127f"/><file name="Invoice.php" hash="3fd8fd3caa22f3202facb9c1c002ee32"/><file name="Order.php" hash="62d3a2e30cbe00b38773a0a6279ee11e"/><file name="Product.php" hash="e2ccb7f50d2acbaca1220c86d51cca27"/><file name="ProductVariation.php" hash="c3042550b9849335c1af13cc26d61504"/></dir><file name="Sync.php" hash="3b17b54554140f94b95dcf98970a5fe1"/><file name="Utils.php" hash="911a0d029646f3c6ed69c812b472afe4"/><file name="Utmz.php" hash="5c3dd712ffba8c7a91641b1aefae47e4"/></dir><dir name="controllers"><file name="IndexController.php" hash="c50f956666fda96b85c09fc6e9ef0506"/></dir><dir name="etc"><file name="adminhtml.xml" hash="aab2ef0e4aedb050d8b60937a085537c"/><file name="config.xml" hash="4bab78c5abeefea5e25b3550c564c40a"/><file name="system.xml" hash="dd6cee8070b16c894b64f1b7d84a4571"/></dir><dir name="sql"><dir name="unityreports_setup"><file name="mysql4-install-0.7.2.php" hash="54f2cbb15d70806b1756c6196d9b3ec1"/><file name="mysql4-upgrade-0.6.2-0.7.2.php" hash="7c1abd7bed806f811ffedf9cdb2c0cc0"/><file name="mysql4-upgrade-0.7.2-0.7.3.php" hash="fcbc4f1c8b216548ee212855142857f8"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Intelivemetrics_Unityreports.xml" hash="ccb9d92196bbc626b5552746ac3ad08b"/></dir></target></contents>
|
18 |
<compatible/>
|
19 |
<dependencies><required><php><min>5.1.0</min><max>7.0.0</max></php></required></dependencies>
|
20 |
</package>
|