RevenueConduitAndInfusionsoft - Version 2.0.11

Version Notes

Now also supports single step checkouts, multiple store fronts

Download this release

Release Info

Developer Parag Jagdale
Extension RevenueConduitAndInfusionsoft
Version 2.0.11
Comparing to
See all releases


Version 2.0.11

app/code/community/RevenueConduit/RevenueConduit/Helper/Data.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * RevenueConduit
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA available
8
+ * through the world-wide-web at this URL:
9
+ * http://revenueconduit.com/magento/license
10
+ *
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ *
13
+ * This package is designed for Magento COMMUNITY edition.
14
+ * =================================================================
15
+ *
16
+ * @package RevenueConduit
17
+ * @copyright Copyright (c) 2012-2013 RevenueConduit. (http://www.revenueconduit.com)
18
+ * @license http://revenueconduit.com/magento/license
19
+ * @terms http://revenueconduit.com/magento/terms
20
+ * @author Parag Jagdale
21
+ */
22
+ ?>
23
+
24
+ <?php
25
+ class RevenueConduit_RevenueConduit_Helper_Data extends Mage_Core_Helper_Abstract{
26
+ }
app/code/community/RevenueConduit/RevenueConduit/Model/Catalog/Product/Api/V2.php ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * RevenueConduit
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA available
8
+ * through the world-wide-web at this URL:
9
+ * http://revenueconduit.com/magento/license
10
+ *
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ *
13
+ * This package is designed for Magento COMMUNITY edition.
14
+ * =================================================================
15
+ *
16
+ * @package RevenueConduit
17
+ * @copyright Copyright (c) 2012-2013 RevenueConduit. (http://www.revenueconduit.com)
18
+ * @license http://revenueconduit.com/magento/license
19
+ * @terms http://revenueconduit.com/magento/terms
20
+ * @author Parag Jagdale
21
+ */
22
+ /**
23
+ * Product Soap Api V2
24
+ */
25
+
26
+ class RevenueConduit_RevenueConduit_Model_Catalog_Product_Api_V2 extends Mage_Catalog_Model_Product_Api_V2
27
+ {
28
+ /**
29
+ * Retrieve list of products with basic info (id, sku, type, set, name)
30
+ * Extended filters capability for catalogProductList
31
+ *
32
+ * @param array $filters
33
+ * @param string|int $store
34
+ * @return array
35
+ */
36
+ public function items($filters = null, $store = null)
37
+ {
38
+ $collection = Mage::getModel('catalog/product')->getCollection()
39
+ ->addStoreFilter($this->_getStoreId($store))
40
+ ->addAttributeToSelect('name');
41
+
42
+ $preparedFilters = array();
43
+ if (isset($filters->filter)) {
44
+ foreach ($filters->filter as $_filterKey => $_filterValue) {
45
+ if (is_object($_filterValue)) {
46
+ $preparedFilters[][$_filterValue->key] = $_filterValue->value;
47
+ } else {
48
+ $preparedFilters[][$_filterKey] = $_filterValue;
49
+ }
50
+ }
51
+ }
52
+ if (isset($filters->complex_filter)) {
53
+ foreach ($filters->complex_filter as $_key => $_filter) {
54
+ $_value = $_filter->value;
55
+ if(is_object($_value)) {
56
+ $preparedFilters[][$_filter->key] = array(
57
+ $_value->key => $_value->value
58
+ );
59
+ } elseif(is_array($_value)) {
60
+ $preparedFilters[][$_key] = array(
61
+ $_filter->key => $_value
62
+ );
63
+ } else {
64
+ $preparedFilters[][$_filter->key] = $_value;
65
+ }
66
+ }
67
+ }
68
+
69
+ if (!empty($preparedFilters)) {
70
+ try {
71
+ foreach ($preparedFilters as $preparedFilter) {
72
+ foreach ($preparedFilter as $field => $value) {
73
+ if (isset($this->_filtersMap[$field])) {
74
+ $field = $this->_filtersMap[$field];
75
+ }
76
+
77
+ $collection->addFieldToFilter($field, $value);
78
+ }
79
+ }
80
+ } catch (Mage_Core_Exception $e) {
81
+ $this->_fault('filters_invalid', $e->getMessage());
82
+ }
83
+ }
84
+
85
+ $result = array();
86
+
87
+ foreach ($collection as $product) {
88
+ $result[] = array(
89
+ 'product_id' => $product->getId(),
90
+ 'sku' => $product->getSku(),
91
+ 'name' => $product->getName(),
92
+ 'set' => $product->getAttributeSetId(),
93
+ 'type' => $product->getTypeId(),
94
+ 'category_ids' => $product->getCategoryIds(),
95
+ 'website_ids' => $product->getWebsiteIds()
96
+ );
97
+ }
98
+
99
+ return $result;
100
+ }
101
+
102
+ public function product_count()
103
+ {
104
+ $_products = Mage::getModel('catalog/product')->getCollection();
105
+ $_productCnt = $_products->count(); //customers count
106
+ return $_productCnt;
107
+ }
108
+
109
+ }
110
+
app/code/community/RevenueConduit/RevenueConduit/Model/Customer/Customer/Api/V2.php ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * RevenueConduit
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA available
8
+ * through the world-wide-web at this URL:
9
+ * http://revenueconduit.com/magento/license
10
+ *
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ *
13
+ * This package is designed for Magento COMMUNITY edition.
14
+ * =================================================================
15
+ *
16
+ * @package RevenueConduit
17
+ * @copyright Copyright (c) 2012-2013 RevenueConduit. (http://www.revenueconduit.com)
18
+ * @license http://revenueconduit.com/magento/license
19
+ * @terms http://revenueconduit.com/magento/terms
20
+ * @author Parag Jagdale
21
+ */
22
+ /**
23
+ * Customer Soap Api V2
24
+ */
25
+ class RevenueConduit_RevenueConduit_Model_Customer_Customer_Api_V2 extends Mage_Customer_Model_Customer_Api_V2
26
+ {
27
+ /**
28
+ * Retrieve cutomers data
29
+ * Extended filters capability for customerCustomerList
30
+ *
31
+ * @param array $filters
32
+ * @return array
33
+ */
34
+ public function items($filters)
35
+ {
36
+ $collection = Mage::getModel('customer/customer')->getCollection()
37
+ ->addAttributeToSelect('*');
38
+
39
+ $preparedFilters = array();
40
+
41
+ if (isset($filters->filter)) {
42
+ foreach ($filters->filter as $_filterKey => $_filterValue) {
43
+ if (is_object($_filterValue)) {
44
+ $preparedFilters[][$_filterValue->key] = $_filterValue->value;
45
+ } else {
46
+ $preparedFilters[][$_filterKey] = $_filterValue;
47
+ }
48
+ }
49
+ }
50
+
51
+ if (isset($filters->complex_filter)) {
52
+ foreach ($filters->complex_filter as $_key => $_filter) {
53
+ $_value = $_filter->value;
54
+ if(is_object($_value)) {
55
+ $preparedFilters[][$_filter->key] = array(
56
+ $_value->key => $_value->value
57
+ );
58
+ } elseif(is_array($_value)) {
59
+ $preparedFilters[][$_key] = array(
60
+ $_filter->key => $_value
61
+ );
62
+ } else {
63
+ $preparedFilters[][$_filter->key] = $_value;
64
+ }
65
+ }
66
+ }
67
+
68
+ if (!empty($preparedFilters)) {
69
+ try {
70
+ foreach ($preparedFilters as $preparedFilter) {
71
+ foreach ($preparedFilter as $field => $value) {
72
+ if (isset($this->_mapAttributes[$field])) {
73
+ $field = $this->_mapAttributes[$field];
74
+ }
75
+
76
+ $collection->addFieldToFilter($field, $value);
77
+ }
78
+ }
79
+ } catch (Mage_Core_Exception $e) {
80
+ $this->_fault('filters_invalid', $e->getMessage());
81
+ }
82
+ }
83
+
84
+ $result = array();
85
+ foreach ($collection as $customer) {
86
+ $data = $customer->toArray();
87
+ $row = array();
88
+
89
+ foreach ($this->_mapAttributes as $attributeAlias => $attributeCode) {
90
+ $row[$attributeAlias] = (isset($data[$attributeCode]) ? $data[$attributeCode] : null);
91
+ }
92
+
93
+ foreach ($this->getAllowedAttributes($customer) as $attributeCode => $attribute) {
94
+ if (isset($data[$attributeCode])) {
95
+ $row[$attributeCode] = $data[$attributeCode];
96
+ }
97
+ }
98
+
99
+ $result[] = $row;
100
+ }
101
+
102
+ return $result;
103
+ }
104
+
105
+ public function customer_count()
106
+ {
107
+ $_customers = Mage::getModel('customer/customer')->getCollection();
108
+ $_customerCnt = $_customers->count(); //customers count
109
+ return $_customerCnt;
110
+ }
111
+ }
112
+
app/code/community/RevenueConduit/RevenueConduit/Model/Observer.php ADDED
@@ -0,0 +1,412 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * RevenueConduit
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA available
8
+ * through the world-wide-web at this URL:
9
+ * http://revenueconduit.com/magento/license
10
+ *
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ *
13
+ * This package is designed for Magento COMMUNITY edition.
14
+ * =================================================================
15
+ *
16
+ * @package RevenueConduit
17
+ * @copyright Copyright (c) 2012-2013 RevenueConduit. (http://www.revenueconduit.com)
18
+ * @license http://revenueconduit.com/magento/license
19
+ * @terms http://revenueconduit.com/magento/terms
20
+ * @author Parag Jagdale
21
+ */
22
+
23
+ class RevenueConduit_RevenueConduit_Model_Observer{
24
+
25
+ var $_infusionsoftConnectionInfo = array();
26
+
27
+ public function load(){
28
+ }
29
+
30
+ public function initialize($observer){
31
+
32
+ if (!($observer->getEvent()->getBlock() instanceof Mage_Adminhtml_Block_Page)) {
33
+ return;
34
+ }
35
+ return $this;
36
+ }
37
+
38
+ public function SendRequest($topic, $orderId, $customerId, $productId=0, $categoryId=0, $quoteId = 0, $original_quote_id = 0, $storeId = 0, $websiteId = 0, $contact_email = null){
39
+ $affiliate = 0;
40
+ $hubspotutk = 0;
41
+
42
+ $company_app_name = '';
43
+ $store_name = '';
44
+ $is_admin = false;
45
+
46
+ $client = new Varien_Http_Client();
47
+
48
+ if(Mage::app()->getStore()->isAdmin())
49
+ {
50
+ $is_admin = true;
51
+ $company_app_name = $this->getStoreConfig('revenueconduit_app_name', 'revenueconduit_revenueconduit_settings_group', $storeId, $websiteId, $is_admin);
52
+ $store_name = $this->getStoreConfig('revenueconduit_store_name', 'revenueconduit_revenueconduit_settings_group', $storeId, $websiteId, $is_admin);
53
+ }else{
54
+ $company_app_name = $this->getStoreConfig('revenueconduit_app_name');
55
+ $store_name = $this->getStoreConfig('revenueconduit_store_name');
56
+ }
57
+
58
+ $storeId = Mage::app()->getStore()->getStoreId();
59
+ $url = Mage::getStoreConfig('web/unsecure/base_link_url', $storeId);
60
+
61
+ $host = "https://app.revenueconduit.com/magento_incoming_requests/receive";
62
+
63
+ $parameter = array("company_app_name" => $company_app_name, "store_name" => $store_name, 'domain' => $url);
64
+
65
+ if(!empty($_COOKIE) && array_key_exists('affiliate', $_COOKIE) && !$is_admin){
66
+ $affiliate = $_COOKIE['affiliate'];
67
+ }
68
+
69
+ if(!empty($_COOKIE) && array_key_exists('hubspotutk', $_COOKIE) and ( $topic == "orders/create" or $topic == "orders/updated" or $topic == "customers/create" or $topic == "customers/update" or $topic == "checkouts/create" or $topic == "checkouts/delete") and !$is_admin){
70
+ $hubspotutk = $_COOKIE['hubspotutk'];
71
+ }
72
+
73
+ $postParameters = array("topic" => $topic, "order_id" => $orderId, "customer_id" => $customerId, "product_id" => $productId, 'category_id' => $categoryId, 'referral_code_id' => $affiliate ? $affiliate : 0, 'quote_id' => $quoteId, 'original_quote_id' => $original_quote_id, 'hubspotutk'=> $hubspotutk, 'contact_email' => $contact_email);
74
+
75
+ $client->setUri($host)
76
+ ->setConfig(array('timeout' => 30))
77
+ ->setParameterGet($parameter)
78
+ ->setParameterPost($postParameters)
79
+ ->setUrlEncodeBody(false)
80
+ ->setMethod(Zend_Http_Client::POST);
81
+
82
+ try {
83
+ $response = $client->request();
84
+ return $response->getBody();
85
+ } catch (Exception $e) {
86
+ Mage::log("Could not send the $topic request to RevenueConduit. Error Message: " . $e->getMessage(), null);
87
+ }
88
+ return null;
89
+ }
90
+
91
+ public function beforeSave($observer){
92
+ try{
93
+ $dataObjectClass = get_class($observer->getEvent()->getDataObject());
94
+ if (!empty($dataObjectClass) && $dataObjectClass == 'Mage_Catalog_Model_Product') {
95
+ $product = $observer->getEvent()->getProduct();
96
+ if(!empty($product) && !$product->getID()) {
97
+ $product->isNewProduct = true;
98
+ }
99
+ }
100
+ }catch(Exception $ex){
101
+ Mage::log("Could not send a product update request to RevenueConduit.", null);
102
+ }
103
+
104
+ return $this;
105
+ }
106
+ public function beforeCategorySave($observer){
107
+ try{
108
+ $dataObjectClass = get_class($observer->getEvent()->getDataObject());
109
+ if (!empty($dataObjectClass) && $dataObjectClass == 'Mage_Catalog_Model_Category') {
110
+ $category = $observer->getEvent()->getCategory();
111
+ if(!empty($category) && !$category->getID()) {
112
+ $category->isNewCategory = true;
113
+ }
114
+ }
115
+ }catch(Exception $ex){
116
+ Mage::log("Could not send a product update request to RevenueConduit.", null);
117
+ }
118
+
119
+ return $this;
120
+ }
121
+
122
+ public function beforeCustomerSave($observer){
123
+ try{
124
+ $dataObjectClass = get_class($observer->getEvent()->getDataObject());
125
+ if (!empty($dataObjectClass) && $dataObjectClass == 'Mage_Customer_Model_Customer') {
126
+ $customer = $observer->getEvent()->getCustomer();
127
+ if(!empty($customer) && !$customer->getID()) {
128
+ $customer->isNewCustomer = true;
129
+ }
130
+ }
131
+ }catch(Exception $ex){
132
+ Mage::log("Could not send a product update request to RevenueConduit.", null);
133
+ }
134
+
135
+ return $this;
136
+ }
137
+ public function UpdateProduct($observer){
138
+
139
+ try{
140
+ if(!Mage::registry('prevent_product_observer')):
141
+ $dataObjectClass = get_class($observer->getEvent()->getDataObject());
142
+ if (!empty($dataObjectClass) && $dataObjectClass == 'Mage_Catalog_Model_Product') {
143
+ $product = $observer->getEvent()->getProduct();
144
+ if(!empty($product) && $product->getID()) {
145
+ $storeIds = $product->getStoreIds();
146
+ if($product->isNewProduct)
147
+ {
148
+ $topic = "products/create";
149
+ }else{
150
+ $topic = "products/update";
151
+ }
152
+ if(!empty($storeIds))
153
+ {
154
+ foreach($storeIds as $storeId)
155
+ {
156
+ $codeFromSite = $this->SendRequest($topic, 0, 0, $product->getID(), 0, 0, 0, $storeId, $product->getWebsiteId());
157
+ }
158
+
159
+ }else{
160
+ $codeFromSite = $this->SendRequest($topic, 0, 0, $product->getID(), 0, 0, 0, $product->getStoreId(), $product->getWebsiteId());
161
+ }
162
+ Mage::register('prevent_product_observer',true);
163
+ }
164
+ }
165
+ endif;
166
+ }catch(Exception $ex){
167
+ Mage::log("Could not send a product update request to RevenueConduit.", null);
168
+ }
169
+
170
+ return $this;
171
+ }
172
+ public function UpdateCategory($observer){
173
+
174
+ try{
175
+ $dataObjectClass = get_class($observer->getEvent()->getDataObject());
176
+ if (!empty($dataObjectClass) && $dataObjectClass == 'Mage_Catalog_Model_Category') {
177
+ $category = $observer->getEvent()->getCategory();
178
+ if($category->isNewCategory) {
179
+ $codeFromSite = $this->SendRequest("categories/create", 0, 0, 0, $category->getID(), 0, 0, $category->getStoreId(), $category->getWebsiteId());
180
+ }
181
+ else {
182
+ $codeFromSite = $this->SendRequest("categories/update", 0, 0, 0, $category->getID(), 0, 0, $category->getStoreId(), $category->getWebsiteId());
183
+ }
184
+ }
185
+ }catch(Exception $ex){
186
+ Mage::log("Could not send a category update request to RevenueConduit.", null);
187
+ }
188
+
189
+ return $this;
190
+ }
191
+ public function UpdateCustomer($observer){
192
+ try{
193
+ if(!Mage::registry('prevent_customer_observer')):
194
+ $dataObjectClass = get_class($observer->getEvent()->getDataObject());
195
+ if (!empty($dataObjectClass) && $dataObjectClass == 'Mage_Customer_Model_Customer') {
196
+ $customer = $observer->getEvent()->getCustomer();
197
+ if (!empty($customer) && $customer->getId()) {
198
+ if($customer->isNewCustomer) {
199
+ $codeFromSite = $this->SendRequest("customers/create", 0, $customer->getId(), 0, 0, 0, 0, $customer->getStoreId(), $customer->getWebsiteId());
200
+ }else {
201
+ $codeFromSite = $this->SendRequest("customers/update", 0, $customer->getId(), 0, 0, 0, 0, $customer->getStoreId(), $customer->getWebsiteId());
202
+ }
203
+ Mage::register('prevent_customer_observer',true);
204
+ }
205
+ }
206
+ endif;
207
+ }catch(Exception $ex){
208
+ Mage::log("Could not send a customer created request to RevenueConduit.", null);
209
+ }
210
+ return $this;
211
+ }
212
+
213
+ public function CreateContactRecord($observer){
214
+ $dataObjectClass = get_class($observer->getEvent()->getDataObject());
215
+ if (!empty($dataObjectClass) && $dataObjectClass == 'Mage_Customer_Model_Customer') {
216
+ $customer = $observer->getEvent()->getCustomer();
217
+ try{
218
+ if (!empty($customer) && $customer->getId()) {
219
+ $codeFromSite = $this->SendRequest("customers/create", 0, $customer->getId(), 0, 0, 0, 0, $customer->getStoreId(), $customer->getWebsiteId());
220
+ }
221
+ }catch(Exception $ex){
222
+ Mage::log("Could not send a customer created request to RevenueConduit.", null);
223
+ }
224
+ }
225
+ return $this;
226
+ }
227
+
228
+ public function AssignOrderSequenceOnCheckout($observer){
229
+
230
+ $orderId = 0;
231
+ $customerId = 0;
232
+
233
+ $order = $observer->getOrder();
234
+ if(!empty($order) && $order->getRealOrderId()) {
235
+ $orderId = $order->getRealOrderId();
236
+ $storeId = $order->getStoreId();
237
+ $websiteId = $order->getWebsiteId();
238
+
239
+ if(Mage::getSingleton('customer/session')->isLoggedIn()) {
240
+ $customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
241
+ }
242
+
243
+ try{
244
+ $codeFromSite = $this->SendRequest("orders/create", $orderId, $customerId, 0, 0, 0, 0, $storeId, $websiteId);
245
+ }catch(Exception $ex){
246
+ Mage::log("Could not send an orders/create request to RevenueConduit. The order Id is: " . $orderId, null);
247
+ }
248
+ }
249
+ return $this;
250
+ }
251
+
252
+ public function OnOrderUpdate($observer){
253
+ try{
254
+ if(!Mage::registry('prevent_order_observer')):
255
+ $dataObjectClass = get_class($observer->getEvent()->getDataObject());
256
+ Mage::register('prevent_order_observer',true);
257
+
258
+ if(!empty($dataObjectClass) && $dataObjectClass == 'Mage_Sales_Model_Order'){
259
+ $order = $observer->getEvent()->getOrder();
260
+ }else{
261
+ $order = $observer->getEvent()->getInvoice()->getOrder();
262
+ }
263
+
264
+ if(!empty($order) && $order->getIncrementId()) {
265
+ $codeFromSite = $this->SendRequest("orders/updated", $order->getIncrementId(), null, 0, 0, 0, 0, $order->getStoreId(), $order->getWebsiteId());
266
+ }
267
+ endif;
268
+ }catch(Exception $ex){
269
+ Mage::log("Could not send an order created request to RevenueConduit. " . $ex->getMessage() , null);
270
+ }
271
+ return $this;
272
+ }
273
+
274
+ public function salesOrderShipmentSaveAfter($observer){
275
+ try{
276
+ if(!Mage::registry('prevent_order_observer')):
277
+ $dataObjectClass = get_class($observer->getEvent()->getDataObject());
278
+ Mage::register('prevent_order_observer',true);
279
+
280
+ if(!empty($dataObjectClass) && $dataObjectClass == 'Mage_Sales_Model_Order'){
281
+ $order = $observer->getEvent()->getOrder();
282
+ }elseif(!empty($dataObjectClass) && $dataObjectClass == 'Mage_Sales_Model_Order_Shipment'){
283
+ $order = $observer->getEvent()->getShipment()->getOrder();
284
+ }else {
285
+ return $this;
286
+ }
287
+ if(!empty($order) && $order->getIncrementId()) {
288
+ $codeFromSite = $this->SendRequest("orders/updated", $order->getIncrementId(), null, 0, 0, 0, 0, $order->getStoreId(), $order->getWebsiteId());
289
+ }
290
+ endif;
291
+ }catch(Exception $ex){
292
+ Mage::log("Could not send an order updated request to RevenueConduit. " . $ex->getMessage() , null);
293
+ }
294
+ return $this;
295
+ }
296
+
297
+ public function salesOrderHoldChange($observer){
298
+ try{
299
+ if(!Mage::registry('prevent_order_observer')):
300
+ $dataObjectClass = get_class($observer->getEvent()->getDataObject());
301
+ if(!empty($dataObjectClass) && $dataObjectClass == 'Mage_Sales_Model_Order'){
302
+ $order = $observer->getEvent()->getOrder();
303
+ $stateProcessing = Mage_Sales_Model_Order::STATE_HOLDED;
304
+ if(!empty($order) && !empty($stateProcessing) && ($order->getState() == $stateProcessing || $order->getOrigData('state') == $stateProcessing)) {
305
+ $codeFromSite = $this->SendRequest("orders/updated", $order->getIncrementId(), null, 0, 0, 0, 0, $order->getStoreId(), $order->getWebsiteId());
306
+ Mage::register('prevent_order_observer',true);
307
+ }
308
+ }
309
+ endif;
310
+ }catch(Exception $ex){
311
+ Mage::log("Could not send an order updated request to RevenueConduit. " . $ex->getMessage() , null);
312
+ }
313
+ return $this;
314
+ }
315
+
316
+ public function captureReferral(Varien_Event_Observer $observer)
317
+ {
318
+ // here we add the logic to capture the referring affiliate ID
319
+ $frontController = $observer->getEvent()->getFront();
320
+ if(!empty($frontController)){
321
+ $affiliateID = $frontController->getRequest()->getParam('affiliate', false);
322
+ if(!empty($affiliateID)){
323
+ $getHostname = null;
324
+ $getHostname = Mage::app()->getFrontController()->getRequest()->getHttpHost();
325
+ setcookie("affiliate", $affiliateID, time()+3600, '/', $getHostname);
326
+ }
327
+ }
328
+ }
329
+
330
+ /*
331
+ * Gets the data from the store configuration
332
+ * @param string keyName - the string which is the key that identifies the value that is requested
333
+ */
334
+ public function getStoreConfig($keyName = null, $group = "revenueconduit_revenueconduit_settings_group", $storeId = 0, $websiteId = 0, $is_admin = false){
335
+ if(!empty($keyName)){
336
+ if(!empty($storeId)) {
337
+ $value = Mage::getStoreConfig("revenueconduit_revenueconduit_options/$group/" . $keyName, $storeId);
338
+ }elseif(!empty($websiteId) && $is_admin) {
339
+ $value = Mage::app()->getWebsite($websiteId)->getConfig("revenueconduit_revenueconduit_options/$group/" . $keyName);
340
+ }else {
341
+ $value = Mage::getStoreConfig("revenueconduit_revenueconduit_options/$group/" . $keyName);
342
+ }
343
+
344
+ if(!empty($storeId) && empty($value) && $is_admin && !empty($websiteId))
345
+ {
346
+ $value = Mage::app()->getWebsite($websiteId)->getConfig("revenueconduit_revenueconduit_options/$group/" . $keyName);
347
+ }
348
+
349
+ if(empty($value) && $is_admin)
350
+ {
351
+ $value = Mage::getStoreConfig("revenueconduit_revenueconduit_options/$group/" . $keyName);
352
+ }
353
+
354
+ if(!empty($value)){
355
+ return trim($value);
356
+ }else{
357
+ return $value;
358
+ }
359
+ }else{
360
+ return null;
361
+ }
362
+ }
363
+
364
+ public function setStoreConfig($keyName, $value){
365
+ Mage::getModel('core/config')->saveConfig('revenueconduit_revenueconduit_options/revenueconduit_revenueconduit_group/' . $keyName, $value );
366
+ }
367
+
368
+
369
+ public function autoRegisterBilling($evt){
370
+
371
+ $configValue = Mage::getStoreConfig('revenueconduit_revenueconduit_options/revenueconduit_revenueconduit_settings_group_abandoned/revenueconduit_abandoned_cart_setting',Mage::app()->getStore());
372
+ if($configValue)
373
+ {
374
+ // retrieve quote items collection
375
+ $itemsCollection = Mage::getSingleton('checkout/session')->getQuote()->getItemsCollection();
376
+
377
+ // get array of all items what can be display directly
378
+ $itemsVisible = Mage::getSingleton('checkout/session')->getQuote()->getAllVisibleItems();
379
+ $quoteId = 0;
380
+ $original_quote_id = 0;
381
+ // retrieve quote items array
382
+ $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();
383
+
384
+ $quote_info = Mage::getSingleton('checkout/session')->getQuote();
385
+
386
+ $quoteId = $quote_info->getEntityId();
387
+ $original_quote_id = Mage::getSingleton('core/session')->getOriginalQuoteId();
388
+
389
+ if(!empty($quoteId)){
390
+ $codeFromSite = $this->SendRequest("checkouts/create", 0, 0, 0, 0, $quoteId, $original_quote_id );
391
+ }
392
+
393
+ }//if
394
+ }
395
+
396
+ public function checkoutsDelete()
397
+ {
398
+ $quoteId = 0;
399
+ $original_quote_id = 0;
400
+ $configValue = Mage::getStoreConfig('revenueconduit_revenueconduit_options/revenueconduit_revenueconduit_settings_group_abandoned/revenueconduit_abandoned_cart_setting',Mage::app()->getStore());
401
+ if($configValue)
402
+ {
403
+ $quote_info = Mage::getSingleton('checkout/session')->getQuote();
404
+ $original_quote_id = Mage::getSingleton('core/session')->getOriginalQuoteId();
405
+
406
+ $quoteId = $quote_info->getEntityId();
407
+ if(!empty($quoteId)){
408
+ $codeFromSite = $this->SendRequest("checkouts/delete", 0, 0, 0, 0, $quoteId , $original_quote_id);
409
+ }
410
+ }//if
411
+ }
412
+ }
app/code/community/RevenueConduit/RevenueConduit/Model/Sales/Order/Api/1.6/V2.php ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Sales
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Order API
29
+ *
30
+ * @category RevenueConduit
31
+ * @package RevenueConduit_RevenueConduit_Sales
32
+ * @author Parag Jagdale (Revenue Conduit)
33
+ */
34
+ class RevenueConduit_RevenueConduit_Model_Sales_Order_Api_V2 extends Mage_Sales_Model_Order_Api
35
+ {
36
+
37
+
38
+ public function light_items($filters = null)
39
+ {
40
+ $orders = array();
41
+
42
+ //TODO: add full name logic
43
+ $billingAliasName = 'billing_o_a';
44
+ $shippingAliasName = 'shipping_o_a';
45
+
46
+ /** @var $orderCollection Mage_Sales_Model_Mysql4_Order_Collection */
47
+ $collection = Mage::getModel("sales/order")->getCollection();
48
+
49
+ $collection->getSelect()
50
+ ->reset(Zend_Db_Select::COLUMNS)
51
+ ->columns('increment_id')
52
+ ->columns('entity_id')
53
+ ->columns('customer_id')
54
+ ->columns('store_id')
55
+ ->columns('created_at')
56
+ ->columns('updated_at')
57
+ ->columns('status')
58
+ ->columns('state');
59
+
60
+
61
+
62
+ if (is_array($filters)) {
63
+ try {
64
+ foreach ($filters as $field => $value) {
65
+ if (isset($this->_attributesMap['order'][$field])) {
66
+ $field = $this->_attributesMap['order'][$field];
67
+ }
68
+
69
+ $collection->addFieldToFilter($field, $value);
70
+ }
71
+ } catch (Mage_Core_Exception $e) {
72
+ $this->_fault('filters_invalid', $e->getMessage());
73
+ }
74
+ }
75
+
76
+ $result = array();
77
+
78
+ foreach ($collection as $order) {
79
+ $result[] = $this->_getAttributes($order, 'order');
80
+ }
81
+
82
+ return $result;
83
+ }
84
+
85
+ /**
86
+ * Retrieve list of orders. Filtration could be applied
87
+ *
88
+ * @param null|object|array $filters
89
+ * @return array
90
+ */
91
+ public function items($filters = null)
92
+ {
93
+ $orders = array();
94
+
95
+ //TODO: add full name logic
96
+ $billingAliasName = 'billing_o_a';
97
+ $shippingAliasName = 'shipping_o_a';
98
+
99
+ /** @var $orderCollection Mage_Sales_Model_Mysql4_Order_Collection */
100
+ $orderCollection = Mage::getModel("sales/order")->getCollection();
101
+ $billingFirstnameField = "$billingAliasName.firstname";
102
+ $billingLastnameField = "$billingAliasName.lastname";
103
+ $shippingFirstnameField = "$shippingAliasName.firstname";
104
+ $shippingLastnameField = "$shippingAliasName.lastname";
105
+ $orderCollection->addAttributeToSelect('*')
106
+ ->addAddressFields()
107
+ ->addExpressionFieldToSelect('billing_firstname', "{{billing_firstname}}",
108
+ array('billing_firstname' => $billingFirstnameField))
109
+ ->addExpressionFieldToSelect('billing_lastname', "{{billing_lastname}}",
110
+ array('billing_lastname' => $billingLastnameField))
111
+ ->addExpressionFieldToSelect('shipping_firstname', "{{shipping_firstname}}",
112
+ array('shipping_firstname' => $shippingFirstnameField))
113
+ ->addExpressionFieldToSelect('shipping_lastname', "{{shipping_lastname}}",
114
+ array('shipping_lastname' => $shippingLastnameField))
115
+ ->addExpressionFieldToSelect('billing_name', "CONCAT({{billing_firstname}}, ' ', {{billing_lastname}})",
116
+ array('billing_firstname' => $billingFirstnameField, 'billing_lastname' => $billingLastnameField))
117
+ ->addExpressionFieldToSelect('shipping_name', 'CONCAT({{shipping_firstname}}, " ", {{shipping_lastname}})',
118
+ array('shipping_firstname' => $shippingFirstnameField, 'shipping_lastname' => $shippingLastnameField)
119
+ );
120
+
121
+ /** @var $apiHelper Mage_Api_Helper_Data */
122
+ $apiHelper = Mage::helper('api');
123
+ $filters = $apiHelper->parseFilters($filters, $this->_attributesMap['order']);
124
+ try {
125
+ foreach ($filters as $field => $value) {
126
+ $orderCollection->addFieldToFilter($field, $value);
127
+ }
128
+ } catch (Mage_Core_Exception $e) {
129
+ $this->_fault('filters_invalid', $e->getMessage());
130
+ }
131
+ foreach ($orderCollection as $order) {
132
+ $orders[] = $this->_getAttributes($order, 'order');
133
+ }
134
+ return $orders;
135
+ }
136
+
137
+ } // Class Mage_Sales_Model_Order_Api End
app/code/community/RevenueConduit/RevenueConduit/Model/Sales/Order/Api/V2.php ADDED
@@ -0,0 +1,388 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Sales
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Order API
29
+ *
30
+ * @category RevenueConduit
31
+ * @package RevenueConduit_RevenueConduit_Sales
32
+ * @author Parag Jagdale (Revenue Conduit)
33
+ */
34
+ class RevenueConduit_RevenueConduit_Model_Sales_Order_Api_V2 extends Mage_Sales_Model_Order_Api
35
+ {
36
+
37
+ function getAllCustomerGroups(){
38
+ //get all customer groups
39
+ $customerGroupsCollection = Mage::getModel('customer/group')->getCollection();
40
+ $customerGroupsCollection->addFieldToFilter('customer_group_code',array('nlike'=>'%auto%'));
41
+ // $customerGroupsCollection->load();
42
+ $groups = array();
43
+ foreach ($customerGroupsCollection as $group){
44
+ $groups[] = $group->getId();
45
+ }
46
+ return $groups;
47
+ }
48
+
49
+ function getAllWbsites(){
50
+ //get all wabsites
51
+ $websites = Mage::getModel('core/website')->getCollection();
52
+ $websiteIds = array();
53
+ foreach ($websites as $website){
54
+ $websiteIds[] = $website->getId();
55
+ }
56
+ return $websiteIds;
57
+ }
58
+
59
+
60
+ public function generate_coupon($data = array())
61
+ {
62
+ $coupon_data = $data->filter;
63
+ foreach($coupon_data as $val){
64
+ ${$val->key} = $val->value;
65
+ }
66
+
67
+ $amount = $discount_amount_value;
68
+ $label = $name = $coupon_label;
69
+ $labels[0] = $label;//default store label
70
+ $coupon = Mage::getModel('salesrule/rule');
71
+ $coupon->setName($name)
72
+ ->setDescription($name)
73
+ ->setFromDate($from_date)
74
+ ->setToDate($to_date)
75
+ ->setCouponCode($coupon_code)
76
+ ->setUsesPerCoupon(1)
77
+ ->setUsesPerCustomer(1)
78
+ ->setCustomerGroupIds($this->getAllCustomerGroups()) //an array of customer grou pids
79
+ ->setIsActive(1)
80
+ //serialized conditions. the following examples are empty
81
+ ->setConditionsSerialized('a:6:{s:4:"type";s:32:"salesrule/rule_condition_combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";}')
82
+ ->setActionsSerialized('a:6:{s:4:"type";s:40:"salesrule/rule_condition_product_combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";}')
83
+ ->setStopRulesProcessing(0)
84
+ ->setIsAdvanced(1)
85
+ ->setProductIds('')
86
+ ->setSortOrder(0)
87
+ ->setSimpleAction($discount_type)
88
+ ->setDiscountAmount($amount)
89
+ ->setDiscountQty(null)
90
+ ->setDiscountStep('0')
91
+ ->setSimpleFreeShipping('0')
92
+ ->setApplyToShipping('0')
93
+ ->setIsRss(0)
94
+ ->setWebsiteIds($this->getAllWbsites())
95
+ ->setCouponType(2)
96
+ ->setStoreLabels($labels)
97
+ ;
98
+ if( $coupon->save() )
99
+ return true;
100
+ else
101
+ return false;
102
+ }
103
+
104
+
105
+
106
+
107
+ public function order_count()
108
+ {
109
+ $_orders = Mage::getModel('sales/order')->getCollection();
110
+ $_orderCnt = $_orders->count(); //orders count
111
+ return $_orderCnt;
112
+ }
113
+
114
+ public function listOfOrderNumbers($filters = null){
115
+ $page = 0;
116
+ $count = null;
117
+ foreach ($filters->complex_filter as $field => $condition) {
118
+ if($condition->key == "page"){
119
+ $page = $condition->value->value;
120
+ unset($filters->complex_filter->field);
121
+ }
122
+ if($condition->key == "count"){
123
+ $count = $condition->value->value;
124
+ unset($filters->complex_filter->field);
125
+ }
126
+ }
127
+
128
+ /** @var $orderCollection Mage_Sales_Model_Mysql4_Order_Collection */
129
+ $orderCollection = Mage::getModel("sales/order")->getCollection();
130
+
131
+ if(!empty($count)){
132
+ if(empty($page)){
133
+ $page = 1;
134
+ }
135
+ $orderCollection->setPage($page,$count);
136
+ }
137
+
138
+ $orderCollection->setOrder('entity_id', 'ASC')
139
+ ->getSelect()
140
+ ->reset(Zend_Db_Select::COLUMNS)
141
+ ->columns('increment_id');
142
+
143
+ $orders = array();
144
+ foreach ($orderCollection as $order) {
145
+ $tmp = $this->_getAttributes($order, 'order');
146
+ if(!empty($tmp['increment_id'])){
147
+ $orders[] = $tmp['increment_id'];
148
+ }
149
+ unset($tmp);
150
+ }
151
+ return $orders;
152
+ }
153
+
154
+ public function light_items($filters = null)
155
+ {
156
+
157
+ $start = 0;
158
+ $count = FALSE;
159
+ foreach ($filters->complex_filter as $field => $condition) {
160
+ if($condition->key == "start"){
161
+ $start = $condition->value->value;
162
+ unset($filters->complex_filter->field);
163
+ }
164
+ if($condition->key == "count"){
165
+ $count = $condition->value->value;
166
+ unset($filters->complex_filter->field);
167
+ }
168
+ }
169
+
170
+ $orders = array();
171
+
172
+ //TODO: add full name logic
173
+ $billingAliasName = 'billing_o_a';
174
+ $shippingAliasName = 'shipping_o_a';
175
+
176
+ /** @var $orderCollection Mage_Sales_Model_Mysql4_Order_Collection */
177
+ $orderCollection = Mage::getModel("sales/order")->getCollection()->setOrder('entity_id', 'ASC');
178
+
179
+ $orderCollection->getSelect()
180
+ ->reset(Zend_Db_Select::COLUMNS)
181
+ ->columns('increment_id')
182
+ ->columns('entity_id')
183
+ ->columns('customer_id')
184
+ ->columns('store_id')
185
+ ->columns('created_at')
186
+ ->columns('updated_at')
187
+ ->columns('status')
188
+ ->columns('state');
189
+
190
+
191
+ /** @var $apiHelper Mage_Api_Helper_Data */
192
+ $apiHelper = Mage::helper('api');
193
+ $filters = $this->parseFilters($filters, $this->_attributesMap['order']);
194
+ try {
195
+ foreach ($filters as $field => $value) {
196
+ if($field == 'start' || $field == 'count') continue;
197
+ $orderCollection->addFieldToFilter($field, $value);
198
+ }
199
+ } catch (Mage_Core_Exception $e) {
200
+ $this->_fault('filters_invalid', $e->getMessage());
201
+ }
202
+
203
+ foreach ($orderCollection as $order) {
204
+ if($start){
205
+ $start--;
206
+ continue;
207
+ }
208
+ $orders[] = $this->_getAttributes($order, 'order');
209
+ if($count !== FALSE && count($orders) == $count){
210
+ break;
211
+ }
212
+ }
213
+ return $orders;
214
+ }
215
+
216
+ /**
217
+ * Retrieve list of orders. Filtration could be applied
218
+ *
219
+ * @param null|object|array $filters
220
+ * @return array
221
+ */
222
+ public function items($filters = null)
223
+ {
224
+ $orders = array();
225
+
226
+ //TODO: add full name logic
227
+ $billingAliasName = 'billing_o_a';
228
+ $shippingAliasName = 'shipping_o_a';
229
+
230
+ /** @var $orderCollection Mage_Sales_Model_Mysql4_Order_Collection */
231
+ $orderCollection = Mage::getModel("sales/order")->getCollection();
232
+ $billingFirstnameField = "$billingAliasName.firstname";
233
+ $billingLastnameField = "$billingAliasName.lastname";
234
+ $shippingFirstnameField = "$shippingAliasName.firstname";
235
+ $shippingLastnameField = "$shippingAliasName.lastname";
236
+ $orderCollection->addAttributeToSelect('*')
237
+ ->addAddressFields()
238
+ ->addExpressionFieldToSelect('billing_firstname', "{{billing_firstname}}",
239
+ array('billing_firstname' => $billingFirstnameField))
240
+ ->addExpressionFieldToSelect('billing_lastname', "{{billing_lastname}}",
241
+ array('billing_lastname' => $billingLastnameField))
242
+ ->addExpressionFieldToSelect('shipping_firstname', "{{shipping_firstname}}",
243
+ array('shipping_firstname' => $shippingFirstnameField))
244
+ ->addExpressionFieldToSelect('shipping_lastname', "{{shipping_lastname}}",
245
+ array('shipping_lastname' => $shippingLastnameField))
246
+ ->addExpressionFieldToSelect('billing_name', "CONCAT({{billing_firstname}}, ' ', {{billing_lastname}})",
247
+ array('billing_firstname' => $billingFirstnameField, 'billing_lastname' => $billingLastnameField))
248
+ ->addExpressionFieldToSelect('shipping_name', 'CONCAT({{shipping_firstname}}, " ", {{shipping_lastname}})',
249
+ array('shipping_firstname' => $shippingFirstnameField, 'shipping_lastname' => $shippingLastnameField)
250
+ );
251
+
252
+ /** @var $apiHelper Mage_Api_Helper_Data */
253
+ $apiHelper = Mage::helper('api');
254
+ $filters = $this->parseFilters($filters, $this->_attributesMap['order']);
255
+ try {
256
+ foreach ($filters as $field => $value) {
257
+ $orderCollection->addFieldToFilter($field, $value);
258
+ }
259
+ } catch (Mage_Core_Exception $e) {
260
+ $this->_fault('filters_invalid', $e->getMessage());
261
+ }
262
+ foreach ($orderCollection as $order) {
263
+ $orders[] = $this->_getAttributes($order, 'order');
264
+ }
265
+ return $orders;
266
+ }
267
+
268
+ public function customer_count()
269
+ {
270
+ $_customers = Mage::getModel('customer/customer')->getCollection();
271
+ $_customerCnt = $_customers->count(); //customers count
272
+ return $_customerCnt;
273
+ }
274
+
275
+ public function product_count()
276
+ {
277
+ $_products = Mage::getModel('catalog/product')->getCollection();
278
+ $_productCnt = $_products->count(); //customers count
279
+ return $_productCnt;
280
+ }
281
+
282
+ public function product_category_count()
283
+ {
284
+ $_products_categories = Mage::getModel('catalog/category')->getCollection();
285
+ $_productCategoryCnt = $_products_categories->count(); //customers count
286
+ return $_productCategoryCnt;
287
+ }
288
+ public function customer_get_subscription_status($email){
289
+ $_subscribers = Mage::getModel('newsletter/subscriber')->loadByEmail($email);
290
+
291
+ return $_subscribers->isSubscribed();
292
+ }
293
+
294
+ /**
295
+ * Parse filters and format them to be applicable for collection filtration
296
+ *
297
+ * @param null|object|array $filters
298
+ * @param array $fieldsMap Map of field names in format: array('field_name_in_filter' => 'field_name_in_db')
299
+ * @return array
300
+ */
301
+ public function parseFilters($filters, $fieldsMap = null)
302
+ {
303
+ // if filters are used in SOAP they must be represented in array format to be used for collection filtration
304
+ if (is_object($filters)) {
305
+ $parsedFilters = array();
306
+ // parse simple filter
307
+ if (isset($filters->filter) && is_array($filters->filter)) {
308
+ foreach ($filters->filter as $field => $value) {
309
+ if (is_object($value) && isset($value->key) && isset($value->value)) {
310
+ $parsedFilters[$value->key] = $value->value;
311
+ } else {
312
+ $parsedFilters[$field] = $value;
313
+ }
314
+ }
315
+ }
316
+ // parse complex filter
317
+ if (isset($filters->complex_filter) && is_array($filters->complex_filter)) {
318
+ $parsedFilters += $this->_parseComplexFilter($filters->complex_filter);
319
+ }
320
+
321
+ $filters = $parsedFilters;
322
+ }
323
+ // make sure that method result is always array
324
+ if (!is_array($filters)) {
325
+ $filters = array();
326
+ }
327
+ // apply fields mapping
328
+ if (isset($fieldsMap) && is_array($fieldsMap)) {
329
+ foreach ($filters as $field => $value) {
330
+ if (isset($fieldsMap[$field])) {
331
+ unset($filters[$field]);
332
+ $field = $fieldsMap[$field];
333
+ $filters[$field] = $value;
334
+ }
335
+ }
336
+ }
337
+ return $filters;
338
+ }
339
+
340
+ /**
341
+ * Parses complex filter, which may contain several nodes, e.g. when user want to fetch orders which were updated
342
+ * between two dates.
343
+ *
344
+ * @param array $complexFilter
345
+ * @return array
346
+ */
347
+ protected function _parseComplexFilter($complexFilter)
348
+ {
349
+ $parsedFilters = array();
350
+
351
+ foreach ($complexFilter as $filter) {
352
+ if (!isset($filter->key) || !isset($filter->value)) {
353
+ continue;
354
+ }
355
+
356
+ list($fieldName, $condition) = array($filter->key, $filter->value);
357
+ $conditionName = $condition->key;
358
+ $conditionValue = $condition->value;
359
+ $this->formatFilterConditionValue($conditionName, $conditionValue);
360
+
361
+ if (array_key_exists($fieldName, $parsedFilters)) {
362
+ $parsedFilters[$fieldName] += array($conditionName => $conditionValue);
363
+ } else {
364
+ $parsedFilters[$fieldName] = array($conditionName => $conditionValue);
365
+ }
366
+ }
367
+
368
+ return $parsedFilters;
369
+ }
370
+
371
+ /**
372
+ * Convert condition value from the string into the array
373
+ * for the condition operators that require value to be an array.
374
+ * Condition value is changed by reference
375
+ *
376
+ * @param string $conditionOperator
377
+ * @param string $conditionValue
378
+ */
379
+ public function formatFilterConditionValue($conditionOperator, &$conditionValue)
380
+ {
381
+ if (is_string($conditionOperator) && in_array($conditionOperator, array('in', 'nin', 'finset'))
382
+ && is_string($conditionValue)
383
+ ) {
384
+ $delimiter = ',';
385
+ $conditionValue = explode($delimiter, $conditionValue);
386
+ }
387
+ }
388
+ } // Class Mage_Sales_Model_Order_Api End
app/code/community/RevenueConduit/RevenueConduit/controllers/IndexController.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * RevenueConduit
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA available
8
+ * through the world-wide-web at this URL:
9
+ * http://revenueconduit.com/magento/license
10
+ *
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ *
13
+ * This package is designed for Magento COMMUNITY edition.
14
+ * =================================================================
15
+ *
16
+ * @package RevenueConduit
17
+ * @copyright Copyright (c) 2012-2013 RevenueConduit. (http://www.revenueconduit.com)
18
+ * @license http://revenueconduit.com/magento/license
19
+ * @terms http://revenueconduit.com/magento/terms
20
+ * @author Parag Jagdale
21
+ */
22
+ ?>
23
+
24
+ <?php
25
+ class RevenueConduit_RevenueConduit_IndexController extends Mage_Core_Controller_Front_Action
26
+ {
27
+ public function indexAction()
28
+ {
29
+
30
+ }
31
+
32
+ public function abandonedAction()
33
+ {
34
+ $quote = Mage::getSingleton('checkout/session')->getQuote();
35
+ $savedQuote = Mage::getModel('sales/quote')
36
+ ->load($this->getRequest()->getParam('quoteid'));
37
+ if ($quote->getId() != $savedQuote->getId() && $savedQuote->getId()) {
38
+ $quote->merge($savedQuote)->save();
39
+ $cart = Mage::getModel('checkout/cart')
40
+ ->setQuote($quote)
41
+ ->init()
42
+ ->save();
43
+
44
+ $old_quote_id = $this->getRequest()->getParam('quoteid');
45
+ if(!empty($old_quote_id)){
46
+ Mage::getSingleton('core/session')->setOriginalQuoteId($old_quote_id);
47
+ }
48
+
49
+ //Delete the previous quote id using checkout delete webhook
50
+ //Commeted this as we dont need delete webhook for previous quote id. We are now sending checkout create with new quote id as well as old quote id. So we dont need the following line
51
+ //Mage::getModel('revenueconduit/observer')->SendRequest("checkouts/delete", 0, 0, 0, 0, $this->getRequest()->getParam('quoteid'));
52
+ }
53
+ $this->_redirect('checkout/cart');
54
+ }
55
+
56
+ public function collectCheckoutDataAction()
57
+ {
58
+ $postData = $this->getRequest()->getPost();
59
+ if(!empty($postData) and !empty($postData['email'])){
60
+
61
+ $contact_email = $postData['email'];
62
+
63
+ if($contact_email == "revenue_conduit_25950997351bc2c9d2b7ea0241464690520375"){
64
+ if (Mage::getSingleton('customer/session')->isLoggedIn() && strpos($_SERVER['HTTP_REFERER'],"checkout") !== false){
65
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
66
+ $contact_email = $customer->getEmail();
67
+ }else{
68
+ $contact_email = null;
69
+ }
70
+ }
71
+
72
+ $quote = Mage::getSingleton('checkout/session')->getQuote();
73
+ $quote_id = $quote->getId();
74
+ if(!empty($quote_id) and !empty($contact_email)){
75
+ $observer = Mage::getModel('revenueconduit/observer');
76
+ $observer->SendRequest("checkouts/create", 0, 0, 0, 0, $quote_id, 0, 0, 0, $contact_email );
77
+ }
78
+ }
79
+ }
80
+ }
app/code/community/RevenueConduit/RevenueConduit/etc/api.xml ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category RevenueConduit
23
+ * @package RevenueConduit_Sales
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+ -->
28
+ <config>
29
+ <api>
30
+ <resources>
31
+ <revenueconduit_sales translate="title" module="revenueconduit">
32
+ <title>revenueconduit</title>
33
+ <model>RevenueConduit_RevenueConduit_Model_Sales_Order_Api</model>
34
+ <acl>revenueconduit_sales/order</acl>
35
+ <methods>
36
+ <!-- For Card 99 - generate coupons -->
37
+ <_generateCoupon translate="title" module="revenueconduit">
38
+ <title>Generate a coupon</title>
39
+ <method>generate_coupon</method>
40
+ <acl>revenueconduit_sales/order</acl>
41
+ </_generateCoupon>
42
+ <_salesOrderList translate="title" module="revenueconduit">
43
+ <title>Retrieve list of orders by filters</title>
44
+ <method>light_items</method>
45
+ <acl>revenueconduit_sales/order</acl>
46
+ </_salesOrderList>
47
+ <_salesOrderIdList translate="title" module="revenueconduit">
48
+ <title>Retrieve list of order numbers by filters</title>
49
+ <method>listOfOrderNumbers</method>
50
+ <acl>revenueconduit_sales/order</acl>
51
+ </_salesOrderIdList>
52
+ <_salesOrderCount translate="title" module="revenueconduit">
53
+ <title>Retrieve count of orders</title>
54
+ <method>order_count</method>
55
+ <acl>revenueconduit_sales/order</acl>
56
+ </_salesOrderCount>
57
+ <_customerCustomerCount translate="title" module="revenueconduit">
58
+ <title>Retrieve count of customers</title>
59
+ <method>customer_count</method>
60
+ <acl>revenueconduit_sales/order</acl>
61
+ </_customerCustomerCount>
62
+ <_catalogProductCount translate="title" module="revenueconduit">
63
+ <title>Retrieve count of products</title>
64
+ <method>product_count</method>
65
+ <acl>revenueconduit_sales/order</acl>
66
+ </_catalogProductCount>
67
+ <_catalogCategoryCount translate="title" module="revenueconduit">
68
+ <title>Retrieve count of product categories</title>
69
+ <method>product_category_count</method>
70
+ <acl>revenueconduit_sales/order</acl>
71
+ </_catalogCategoryCount>
72
+ <_customerIsSubscribed translate="title" module="revenueconduit">
73
+ <title>Check if customer is subscribed</title>
74
+ <method>customer_get_subscription_status</method>
75
+ <acl>revenueconduit_sales/order</acl>
76
+ </_customerIsSubscribed>
77
+ </methods>
78
+ <faults module="revenueconduit"> <not_exists>
79
+ <code>100</code>
80
+ <message>Requested order not exists.</message>
81
+ </not_exists>
82
+ <filters_invalid>
83
+ <code>101</code>
84
+ <message>Invalid filters given. Details in error message.</message>
85
+ </filters_invalid>
86
+ <data_invalid>
87
+ <code>102</code>
88
+ <message>Invalid data given. Details in error message.</message>
89
+ </data_invalid>
90
+ <status_not_changed>
91
+ <code>103</code>
92
+ <message>Order status not changed. Details in error message.</message>
93
+ </status_not_changed>
94
+ </faults>
95
+ </revenueconduit_sales>
96
+ </resources>
97
+ <resources_alias>
98
+ <order>sales_order</order>
99
+ </resources_alias>
100
+ <v2>
101
+ <resources_function_prefix>
102
+ <revenueconduit_sales>RevenueConduit</revenueconduit_sales>
103
+ </resources_function_prefix>
104
+ </v2>
105
+ <acl>
106
+ <resources>
107
+ <revenueconduit_sales translate="title" module="revenueconduit">
108
+ <title>Sales</title>
109
+ <sort_order>2</sort_order>
110
+ <order translate="title" module="revenueconduit">
111
+ <title>Order</title>
112
+ <change translate="title" module="revenueconduit">
113
+ <title>Change status, add comments</title>
114
+ </change>
115
+ </order>
116
+ </revenueconduit_sales>
117
+ </resources>
118
+ </acl>
119
+ </api>
120
+ </config>
121
+
app/code/community/RevenueConduit/RevenueConduit/etc/config.xml ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <RevenueConduit_RevenueConduit>
5
+ <version>1.0.2</version>
6
+ <depends>
7
+ <Mage_Catalog />
8
+ <Mage_Customer />
9
+ </depends>
10
+ </RevenueConduit_RevenueConduit>
11
+ </modules>
12
+ <frontend>
13
+ <routers>
14
+ <revenueconduit>
15
+ <use>standard</use>
16
+ <args>
17
+ <module>RevenueConduit_RevenueConduit</module>
18
+ <frontName>revenueconduit</frontName>
19
+ </args>
20
+ </revenueconduit>
21
+ </routers>
22
+ </frontend>
23
+ <global>
24
+ <models>
25
+ <revenueconduit>
26
+ <class>RevenueConduit_RevenueConduit_Model</class>
27
+ </revenueconduit>
28
+ <catalog>
29
+ <rewrite>
30
+ <product_api_v2>RevenueConduit_RevenueConduit_Model_Catalog_Product_Api_V2</product_api_v2>
31
+ </rewrite>
32
+ </catalog>
33
+ <customer>
34
+ <rewrite>
35
+ <customer_api_v2>RevenueConduit_RevenueConduit_Model_Customer_Customer_Api_V2</customer_api_v2>
36
+ </rewrite>
37
+ </customer>
38
+ </models>
39
+ <helpers>
40
+ <revenueconduit>
41
+ <class>RevenueConduit_RevenueConduit_Helper</class>
42
+ </revenueconduit>
43
+ </helpers>
44
+ <events>
45
+ <sales_convert_quote_to_order>
46
+ <observers>
47
+ <checkouts_delete>
48
+ <type>singleton</type>
49
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
50
+ <method>checkoutsDelete</method>
51
+ </checkouts_delete>
52
+ </observers>
53
+ </sales_convert_quote_to_order>
54
+ <controller_action_postdispatch_checkout_onepage_saveBilling>
55
+ <observers>
56
+ <auto_register_shipping>
57
+ <type>singleton</type>
58
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
59
+ <method>autoRegisterBilling</method>
60
+ </auto_register_shipping>
61
+ </observers>
62
+ </controller_action_postdispatch_checkout_onepage_saveBilling>
63
+ <catalog_product_save_after>
64
+ <observers>
65
+ <revenueconduit_RevenueConduit_customer_observer>
66
+ <type>singleton</type>
67
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
68
+ <method>UpdateProduct</method>
69
+ </revenueconduit_RevenueConduit_customer_observer>
70
+ </observers>
71
+ </catalog_product_save_after>
72
+ <catalog_product_save_before>
73
+ <observers>
74
+ <revenueconduit_RevenueConduit_customer_observer>
75
+ <type>singleton</type>
76
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
77
+ <method>beforeSave</method>
78
+ </revenueconduit_RevenueConduit_customer_observer>
79
+ </observers>
80
+ </catalog_product_save_before>
81
+ <catalog_category_save_before>
82
+ <observers>
83
+ <revenueconduit_RevenueConduit_customer_observer>
84
+ <type>singleton</type>
85
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
86
+ <method>beforeCategorySave</method>
87
+ </revenueconduit_RevenueConduit_customer_observer>
88
+ </observers>
89
+ </catalog_category_save_before>
90
+ <catalog_category_save_after>
91
+ <observers>
92
+ <revenueconduit_RevenueConduit_customer_observer>
93
+ <type>singleton</type>
94
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
95
+ <method>UpdateCategory</method>
96
+ </revenueconduit_RevenueConduit_customer_observer>
97
+ </observers>
98
+ </catalog_category_save_after>
99
+ <customer_save_before>
100
+ <observers>
101
+ <revenueconduit_RevenueConduit_customer_observer>
102
+ <type>singleton</type>
103
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
104
+ <method>beforeCustomerSave</method>
105
+ </revenueconduit_RevenueConduit_customer_observer>
106
+ </observers>
107
+ </customer_save_before>
108
+ <customer_save_after>
109
+ <observers>
110
+ <revenueconduit_RevenueConduit_customer_observer>
111
+ <type>singleton</type>
112
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
113
+ <method>UpdateCustomer</method>
114
+ </revenueconduit_RevenueConduit_customer_observer>
115
+ </observers>
116
+ </customer_save_after>
117
+ <catalog_product_duplicate>
118
+ <observers>
119
+ <revenueconduit_RevenueConduit_customer_observer>
120
+ <type>singleton</type>
121
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
122
+ <method>UpdateProduct</method>
123
+ </revenueconduit_RevenueConduit_customer_observer>
124
+ </observers>
125
+ </catalog_product_duplicate>
126
+ <customer_register_success>
127
+ <observers>
128
+ <revenueconduit_RevenueConduit_customer_observer>
129
+ <type>singleton</type>
130
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
131
+ <method>CreateContactRecord</method>
132
+ </revenueconduit_RevenueConduit_customer_observer>
133
+ </observers>
134
+ </customer_register_success>
135
+ <sales_order_place_after>
136
+ <observers>
137
+ <revenueconduit_RevenueConduit_customer_observer_a>
138
+ <type>singleton</type>
139
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
140
+ <method>AssignOrderSequenceOnCheckout</method>
141
+ </revenueconduit_RevenueConduit_customer_observer_a>
142
+ </observers>
143
+ </sales_order_place_after>
144
+       <sales_order_invoice_pay>
145
+ <observers>
146
+ <revenueconduit_RevenueConduit_order_saved>
147
+ <type>singleton</type>
148
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
149
+ <method>OnOrderUpdate</method>
150
+ </revenueconduit_RevenueConduit_order_saved>
151
+         </observers>
152
+       </sales_order_invoice_pay>
153
+ <sales_order_shipment_save_after>
154
+ <observers>
155
+ <revenueconduit_RevenueConduit_order_saved>
156
+ <type>singleton</type>
157
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
158
+ <method>salesOrderShipmentSaveAfter</method>
159
+ </revenueconduit_RevenueConduit_order_saved>
160
+         </observers>
161
+       </sales_order_shipment_save_after>
162
+ <sales_order_save_after>
163
+ <observers>
164
+ <revenueconduit_RevenueConduit_order_saved>
165
+ <type>singleton</type>
166
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
167
+ <method>salesOrderHoldChange</method>
168
+ </revenueconduit_RevenueConduit_order_saved>
169
+         </observers>
170
+       </sales_order_save_after>
171
+       <sales_order_save_commit_after>
172
+ <observers>
173
+ <revenueconduit_RevenueConduit_order_saved>
174
+ <type>singleton</type>
175
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
176
+ <method>OnOrderUpdate</method>
177
+ </revenueconduit_RevenueConduit_order_saved>
178
+         </observers>
179
+       </sales_order_save_commit_after>
180
+       <controller_front_init_before>
181
+ <observers>
182
+ <revenueconduit_RevenueConduit_order_saved>
183
+ <type>singleton</type>
184
+ <class>RevenueConduit_RevenueConduit_Model_Observer</class>
185
+ <method>captureReferral</method>
186
+ </revenueconduit_RevenueConduit_order_saved>
187
+         </observers>
188
+       </controller_front_init_before>
189
+ </events>
190
+ </global>
191
+ <adminhtml>
192
+ <acl>
193
+ <resources>
194
+ <admin>
195
+ <children>
196
+ <system>
197
+ <children>
198
+ <config>
199
+ <children>
200
+ <revenueconduit_revenueconduit_options>
201
+ <title>RevenueConduit Infusionsoft Settings Section</title>
202
+ </revenueconduit_revenueconduit_options>
203
+ </children>
204
+ </config>
205
+ </children>
206
+ </system>
207
+ </children>
208
+ </admin>
209
+ </resources>
210
+ </acl>
211
+ </adminhtml>
212
+ </config>
213
+ <!--
214
+ /**
215
+ * RevenueConduit
216
+ *
217
+ * NOTICE OF LICENSE
218
+ *
219
+ * This source file is subject to the EULA available
220
+ * through the world-wide-web at this URL:
221
+ * http://revenueconduit.com/magento/license
222
+ *
223
+ * MAGENTO EDITION USAGE NOTICE
224
+ *
225
+ * This package is designed for Magento COMMUNITY edition.
226
+ * =================================================================
227
+ *
228
+ * @package RevenueConduit
229
+ * @copyright Copyright (c) 2012-2013 RevenueConduit. (http://www.revenueconduit.com)
230
+ * @license http://revenueconduit.com/magento/license
231
+ * @terms http://revenueconduit.com/magento/terms
232
+ * @author Parag Jagdale
233
+ */
234
+ -->
app/code/community/RevenueConduit/RevenueConduit/etc/system.xml ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <revenueconduittab translate="label" module="revenueconduit">
5
+ <label>Revenue Conduit</label>
6
+ <sort_order>100</sort_order>
7
+ </revenueconduittab>
8
+ </tabs>
9
+ <sections>
10
+ <revenueconduit_revenueconduit_options translate="label" module="revenueconduit">
11
+ <label>Revenue Conduit</label>
12
+ <tab>revenueconduittab</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>199</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <expanded>1</expanded>
19
+ <groups>
20
+ <revenueconduit_revenueconduit_settings_group translate="label">
21
+ <label>Revenue Conduit Settings</label>
22
+ <frontend_type>text</frontend_type>
23
+ <sort_order>1</sort_order>
24
+ <show_in_default>1</show_in_default>
25
+ <show_in_website>1</show_in_website>
26
+ <show_in_store>1</show_in_store>
27
+
28
+ <fields>
29
+ <revenueconduit_app_name translate="label">
30
+ <label>Revenue Conduit Application Name</label>
31
+ <comment>The app name given to your Revenue Conduit account</comment>
32
+ <frontend_type>text</frontend_type>
33
+ <sort_order>1</sort_order>
34
+ <show_in_default>1</show_in_default>
35
+ <show_in_website>1</show_in_website>
36
+ <show_in_store>1</show_in_store>
37
+ </revenueconduit_app_name>
38
+ <revenueconduit_store_name translate="label">
39
+ <label>Revenue Conduit Store Name</label>
40
+ <comment>The unique store name configured in your Revenue Conduit account</comment>
41
+ <frontend_type>text</frontend_type>
42
+ <sort_order>2</sort_order>
43
+ <show_in_default>1</show_in_default>
44
+ <show_in_website>1</show_in_website>
45
+ <show_in_store>1</show_in_store>
46
+ </revenueconduit_store_name>
47
+ </fields>
48
+ </revenueconduit_revenueconduit_settings_group>
49
+ <!-- START for branch 130-magento-extension-add-ability-to-turn-on-and-turn-of-abandoned-cart-checkout-webhooks -->
50
+ <revenueconduit_revenueconduit_settings_group_abandoned translate="label">
51
+ <label>Abandoned Cart</label>
52
+ <frontend_type>text</frontend_type>
53
+ <sort_order>2</sort_order>
54
+ <show_in_default>1</show_in_default>
55
+ <show_in_website>1</show_in_website>
56
+ <show_in_store>1</show_in_store>
57
+ <fields>
58
+ <revenueconduit_abandoned_cart_setting translate="label">
59
+ <label>Enable Abandoned Cart</label>
60
+ <comment>Select 'Yes' to enable the Abandoned Cart integration with Revenue Conduit. The Abandoned Cart feature must be added to the Revenue Conduit account that this store is connected to. If it is not enabled in Revenue Conduit, enabling this setting in Magento alone will have no effect.</comment>
61
+ <frontend_type>Select</frontend_type>
62
+ <source_model>adminhtml/system_config_source_yesno</source_model>
63
+ <sort_order>1</sort_order>
64
+ <show_in_default>1</show_in_default>
65
+ <show_in_website>1</show_in_website>
66
+ <show_in_store>1</show_in_store>
67
+ </revenueconduit_abandoned_cart_setting>
68
+ </fields>
69
+ </revenueconduit_revenueconduit_settings_group_abandoned>
70
+ <!-- END for branch 130-magento-extension-add-ability-to-turn-on-and-turn-of-abandoned-cart-checkout-webhooks -->
71
+ </groups>
72
+ </revenueconduit_revenueconduit_options>
73
+ </sections>
74
+ </config>
75
+ <!--
76
+ /**
77
+ * RevenueConduit
78
+ *
79
+ * NOTICE OF LICENSE
80
+ *
81
+ * This source file is subject to the EULA available
82
+ * through the world-wide-web at this URL:
83
+ * http://revenueconduit.com/magento/license
84
+ *
85
+ * MAGENTO EDITION USAGE NOTICE
86
+ *
87
+ * This package is designed for Magento COMMUNITY edition.
88
+ * =================================================================
89
+ *
90
+ * @package RevenueConduit
91
+ * @copyright Copyright (c) 2012-2013 RevenueConduit. (http://www.revenueconduit.com)
92
+ * @license http://revenueconduit.com/magento/license
93
+ * @terms http://revenueconduit.com/magento/terms
94
+ * @author Parag Jagdale
95
+ */
96
+ -->
app/code/community/RevenueConduit/RevenueConduit/etc/wsdl.xml ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <definitions xmlns:typens="urn:{{var wsdl.name}}" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
3
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/"
4
+ name="{{var wsdl.name}}" targetNamespace="urn:{{var wsdl.name}}">
5
+ <types>
6
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:Magento">
7
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/" />
8
+ <complexType name="RevenueConduit_salesOrderListEntity">
9
+ <all>
10
+ <element name="increment_id" type="xsd:string" minOccurs="0" />
11
+ <element name="store_id" type="xsd:string" minOccurs="0" />
12
+ <element name="created_at" type="xsd:string" minOccurs="0" />
13
+ <element name="updated_at" type="xsd:string" minOccurs="0" />
14
+ <element name="customer_id" type="xsd:string" minOccurs="0" />
15
+ <element name="status" type="xsd:string" minOccurs="0" />
16
+ <element name="state" type="xsd:string" minOccurs="0" />
17
+ <element name="order_id" type="xsd:string" minOccurs="0" />
18
+ </all>
19
+ </complexType>
20
+ <complexType name="RevenueConduit_salesOrderListEntityArray">
21
+ <complexContent>
22
+ <restriction base="soapenc:Array">
23
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:RevenueConduit_salesOrderListEntity[]" />
24
+ </restriction>
25
+ </complexContent>
26
+ </complexType>
27
+ <!-- For Card 99 - generate coupons -->
28
+ <complexType name="RevenueConduit_generateCouponEntity">
29
+ <all>
30
+ </all>
31
+ </complexType>
32
+ <complexType name="RevenueConduit_generateCouponEntityArray">
33
+ <complexContent>
34
+ <restriction base="soapenc:Array">
35
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:RevenueConduit_generateCouponEntity[]" />
36
+ </restriction>
37
+ </complexContent>
38
+ </complexType>
39
+ <complexType name="RevenueConduit_salesOrderIdListEntity">
40
+ <all>
41
+ </all>
42
+ </complexType>
43
+ <complexType name="RevenueConduit_salesOrderIdListEntityArray">
44
+ <complexContent>
45
+ <restriction base="soapenc:Array">
46
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="typens:RevenueConduit_salesOrderIdListEntity[]" />
47
+ </restriction>
48
+ </complexContent>
49
+ </complexType>
50
+ </schema>
51
+ </types>
52
+ <!-- For Card 99 - generate coupons -->
53
+ <message name="RevenueConduit_generateCouponRequest">
54
+ <part name="sessionId" type="xsd:string" />
55
+ <part name="filters" type="typens:filters" />
56
+ </message>
57
+ <message name="RevenueConduit_generateCouponResponse">
58
+ <part name="result" type="typens:generateCouponEntityArray" />
59
+ </message>
60
+ <message name="RevenueConduit_salesOrderListRequest">
61
+ <part name="sessionId" type="xsd:string" />
62
+ <part name="filters" type="typens:filters" />
63
+ </message>
64
+ <message name="RevenueConduit_salesOrderListResponse">
65
+ <part name="result" type="typens:salesOrderListEntityArray" />
66
+ </message>
67
+ <message name="RevenueConduit_salesOrderIdListRequest">
68
+ <part name="sessionId" type="xsd:string" />
69
+ <part name="filters" type="typens:filters" />
70
+ </message>
71
+ <message name="RevenueConduit_salesOrderIdListResponse">
72
+ <part name="result" type="typens:salesOrderIdListEntityArray" />
73
+ </message>
74
+ <message name="RevenueConduit_salesOrderCountRequest">
75
+ <part name="sessionId" type="xsd:string" />
76
+ <part name="filters" type="typens:filters" />
77
+ </message>
78
+ <message name="RevenueConduit_salesOrderCountResponse">
79
+ <part name="result" type="xsd:int" />
80
+ </message>
81
+ <message name="RevenueConduit_salesOrderInputEmail">
82
+ <part name="sessionId" type="xsd:string" />
83
+ <part name="filters" type="xsd:string" />
84
+ </message>
85
+ <portType name="{{var wsdl.handler}}PortType">
86
+ <!-- For Card 99 - generate coupons -->
87
+ <operation name="RevenueConduit_generateCoupon">
88
+ <documentation>Generate coupon code</documentation>
89
+ <input message="typens:RevenueConduit_generateCouponRequest" />
90
+ <output message="typens:RevenueConduit_generateCouponResponse" />
91
+ </operation>
92
+ <operation name="RevenueConduit_salesOrderList">
93
+ <documentation>Retrieve list of orders by filters</documentation>
94
+ <input message="typens:RevenueConduit_salesOrderListRequest" />
95
+ <output message="typens:RevenueConduit_salesOrderListResponse" />
96
+ </operation>
97
+ <operation name="RevenueConduit_salesOrderIdList">
98
+ <documentation>Retrieve list of order numbers by filters</documentation>
99
+ <input message="typens:RevenueConduit_salesOrderIdListRequest" />
100
+ <output message="typens:RevenueConduit_salesOrderIdListResponse" />
101
+ </operation>
102
+ <operation name="RevenueConduit_salesOrderCount">
103
+ <documentation>Retrieve count of orders by filters</documentation>
104
+ <input message="typens:RevenueConduit_salesOrderCountRequest" />
105
+ <output message="typens:RevenueConduit_salesOrderCountResponse" />
106
+ </operation>
107
+ <operation name="RevenueConduit_customerCustomerCount">
108
+ <documentation>Retrieve count of customers by filters</documentation>
109
+ <input message="typens:RevenueConduit_salesOrderCountRequest" />
110
+ <output message="typens:RevenueConduit_salesOrderCountResponse" />
111
+ </operation>
112
+ <operation name="RevenueConduit_catalogProductCount">
113
+ <documentation>Retrieve count of products by filters</documentation>
114
+ <input message="typens:RevenueConduit_salesOrderCountRequest" />
115
+ <output message="typens:RevenueConduit_salesOrderCountResponse" />
116
+ </operation>
117
+ <operation name="RevenueConduit_catalogCategoryCount">
118
+ <documentation>Retrieve count of Categories by filters</documentation>
119
+ <input message="typens:RevenueConduit_salesOrderCountRequest" />
120
+ <output message="typens:RevenueConduit_salesOrderCountResponse" />
121
+ </operation>
122
+ <operation name="RevenueConduit_customerIsSubscribed">
123
+ <documentation>Check if customer has subscribed to newsletters</documentation>
124
+ <input message="typens:RevenueConduit_salesOrderInputEmail" />
125
+ <output message="typens:RevenueConduit_salesOrderCountResponse" />
126
+ </operation>
127
+ </portType>
128
+ <binding name="{{var wsdl.handler}}Binding" type="typens:{{var wsdl.handler}}PortType">
129
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
130
+ <!-- For Card 99 - generate coupons -->
131
+ <operation name="RevenueConduit_generateCoupon">
132
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
133
+ <input>
134
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
135
+ </input>
136
+ <output>
137
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
138
+ </output>
139
+ </operation>
140
+ <operation name="RevenueConduit_salesOrderList">
141
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
142
+ <input>
143
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
144
+ </input>
145
+ <output>
146
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
147
+ </output>
148
+ </operation>
149
+ <operation name="RevenueConduit_salesOrderIdList">
150
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
151
+ <input>
152
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
153
+ </input>
154
+ <output>
155
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
156
+ </output>
157
+ </operation>
158
+ <operation name="RevenueConduit_salesOrderCount">
159
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
160
+ <input>
161
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
162
+ </input>
163
+ <output>
164
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
165
+ </output>
166
+ </operation>
167
+ <operation name="RevenueConduit_customerCustomerCount">
168
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
169
+ <input>
170
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
171
+ </input>
172
+ <output>
173
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
174
+ </output>
175
+ </operation>
176
+ <operation name="RevenueConduit_catalogProductCount">
177
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
178
+ <input>
179
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
180
+ </input>
181
+ <output>
182
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
183
+ </output>
184
+ </operation>
185
+ <operation name="RevenueConduit_catalogCategoryCount">
186
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
187
+ <input>
188
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
189
+ </input>
190
+ <output>
191
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
192
+ </output>
193
+ </operation>
194
+ <operation name="RevenueConduit_customerIsSubscribed">
195
+ <soap:operation soapAction="urn:{{var wsdl.handler}}Action" />
196
+ <input>
197
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
198
+ </input>
199
+ <output>
200
+ <soap:body namespace="urn:{{var wsdl.name}}" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
201
+ </output>
202
+ </operation>
203
+ </binding>
204
+ <service name="{{var wsdl.name}}Service">
205
+ <port name="{{var wsdl.handler}}Port" binding="typens:{{var wsdl.handler}}Binding">
206
+ <soap:address location="{{var wsdl.url}}" />
207
+ </port>
208
+ </service>
209
+ </definitions>
210
+
app/etc/modules/RevenueConduit_RevenueConduit.xml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * RevenueConduit
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA available
9
+ * through the world-wide-web at this URL:
10
+ * http://revenueconduit.com/magento/license
11
+ *
12
+ * MAGENTO EDITION USAGE NOTICE
13
+ *
14
+ * This package is designed for Magento COMMUNITY edition.
15
+ * =================================================================
16
+ *
17
+ * @package RevenueConduit
18
+ * @copyright Copyright (c) 2012-2013 RevenueConduit. (http://www.revenueconduit.com)
19
+ * @license http://revenueconduit.com/magento/license
20
+ * @terms http://revenueconduit.com/magento/terms
21
+ * @author Parag Jagdale
22
+ */
23
+ -->
24
+ <config>
25
+ <modules>
26
+ <RevenueConduit_RevenueConduit>
27
+ <active>true</active>
28
+ <codePool>community</codePool>
29
+ </RevenueConduit_RevenueConduit>
30
+ </modules>
31
+ </config>
32
+
33
+
package.xml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>RevenueConduitAndInfusionsoft</name>
4
+ <version>2.0.11</version>
5
+ <stability>stable</stability>
6
+ <license>Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Infusionsoft and Magento Integration by Revenue Conduit&#xD;
10
+ Sign up for a 14 day FREE Trial and see what Revenue Conduit can do for you. Then benefit from a low monthly cost starting at $49.95 with no up-front fees or long-term commitments.&#xD;
11
+ Grow your Magento store, Automatically&#xD;
12
+ Benefit from a complete marketing system when you connect your Magento store to Infusionsoft through Revenue Conduit&#xD;
13
+ Feature-Packed and Full of Benefits&#xD;
14
+ Complimentary Full Historical Sync &amp; Real Time 80/20 Statistics&#xD;
15
+ Shortly after connecting Revenue Conduit to Infusionsoft and your shopping cart, we&#x2019;ll build the required fields and start syncing your historical customer and order data. We also enable the real time 80/20 analysis through which you always look for &#x201C;low-hanging fruit&#x201D; campaigns that offer a relatively easy and immediate source of revenue and profit.&#xD;
16
+ Shopping Cart Abandonment Marketing &#xD;
17
+ Automatically recover abandoned shopping carts through a powerful, customizable Infusionsoft campaign. Check your data - it&#x2019;s likely that upwards of 70% of your carts are abandoned. Now, with Revenue Conduit, you can automatically recover more lost carts to grow your top and bottom line. Include your product pictures, cart items and details in a multi-step email campaign. Configure the campaign to provide a coupon code every time your customer abandons a cart, or protect yourself from your customers gaming the system and only deliver a coupon code every other or every third time.&#xD;
18
+ Order Automation &#xD;
19
+ Automatically start one or more Infusionsoft campaigns when a customer places an order&#xD;
20
+ Sync Customers, Orders and Products &#xD;
21
+ As your customers buy, Revenue Conduit automatically syncs all your customers, orders and products to the Infusionsoft CRM system.&#xD;
22
+ Associate Tags to Products and Categories &#xD;
23
+ Infusionsoft uses Tags to segment customers based on what they bought, what they are interested in and how engaged they are. With Revenue Conduit, you can associate any number of Tags to any of your products and product categories, allowing you to easily segment your customers based on their buying behaviors and interests. Why would you want to do this? Think automatic upsell and cross-sell campaigns.&#xD;
24
+ 6 Free Infusionsoft Campaigns &#xD;
25
+ Revenue Conduit is not just an integration. We provide a Marketing System for online retailers. Within 24 to 48 hours after you sign up for our Free Marketing System, Revenue Conduit will install 6 campaigns, custom fields, Tags, saved searches and dashboard widgets into your Infusionsoft app. Revenue Conduit was co-founded by Daniel Kurt, an Infusionsoft Certified Consultant with ecommerce expertise and the Marketing System is worth thousands of dollars. You get it for FREE when you sign up for a 30-day free trial.&#xD;
26
+ RFM Segmentation &#xD;
27
+ This one feature alone can provide you with a return on your investment in Revenue Conduit and Infusionsoft. Automatically segment your customers based on the last time they bought, how many times they bought and how much they have spent. Using data that Revenue Conduit calculates prior to syncing your customer after they place an order, your customers will be given a 1-5 rating for Order Recency, Order Frequency and Monetary. This is called RFM Segmentation. The big ecommerce companies use it, and now you can, too!&#xD;
28
+ Campaign ROI Tracking &#xD;
29
+ As part of our Marketing System, you can easily see how much revenue your campaigns generate and track your return on investment. We even build Infusionsoft Dashboard Widgets that show you the ROI and other vital metrics from the 6 Infusionsoft campaigns that come with Revenue Conduit.&#xD;
30
+ Referral Partner Integration &#xD;
31
+ Infusionsoft includes a powerful referral partner system that allows you to build and manage a referral partner program that compensates your partners for sales they help you generate. Revenue Conduit makes it possible for you to sell on your Magento store and track sales and commissions in Infusionsoft.&#xD;
32
+ Newsletter Opt-in &#xD;
33
+ If your customer opts-in to your marketing during checkout, Revenue Conduit will apply your Newsletter Tag to their contact record. Whether or not you use this feature, Revenue Conduit syncs all customers to Infusionsoft as marketable.&#xD;
34
+ Customer Group Sync &#xD;
35
+ Revenue Conduit syncs your customer group to Infusionsoft, allowing you to have specific follow up for Retail, Wholesale, and any other customized Magento customer groups in your business.&#xD;
36
+ Coupon Code Generation, Sync and Automation &#xD;
37
+ Automatically generate one-time use and expiring coupon codes when your visitor opts-in and send the code to them through an Infusionsoft email. Segment customers based on the coupon codes they have used, and track your ROI of each coupon code.&#xD;
38
+ Field to Field Sync &#xD;
39
+ Sync virtually any native Magento field into a field in Infusionsoft.&#xD;
40
+ Order Status Automation &#xD;
41
+ Easily run campaigns based on a change in your order status. For instance, run a campaign when an order is initially placed, or when an order is shipped, canceled or refunded.&#xD;
42
+ Support for Multiple Stores &#xD;
43
+ Do you sell on more than one Magento storefront? Do you want to connect each store to a single Infusionsoft app? We can help. Each store will need its own Revenue Conduit app, and you will be able to segment based each individual store within Infusionsoft.&#xD;
44
+ More Features Added Every Few Weeks &#xD;
45
+ We&#x2019;re constantly innovating and listening to our customers for feature suggestions. Have an idea? Let us know and we&#x2019;ll see what we can do for you.&#xD;
46
+ Interested in a demo? Visit wwww.revenueconduit.com/magento to learn more.</summary>
47
+ <description>Infusionsoft and Magento Integration by Revenue Conduit&#xD;
48
+ Sign up for a 14 day FREE Trial and see what Revenue Conduit can do for you. Then benefit from a low monthly cost starting at $49.95 with no up-front fees or long-term commitments.&#xD;
49
+ &#xD;
50
+ Grow your Magento store, Automatically&#xD;
51
+ Benefit from a complete marketing system when you connect your Magento store to Infusionsoft through Revenue Conduit</description>
52
+ <notes>Now also supports single step checkouts, multiple store fronts</notes>
53
+ <authors><author><name>RevenueConduit</name><user>RevenueConduit</user><email>support@revenueconduit.com</email></author></authors>
54
+ <date>2017-03-21</date>
55
+ <time>12:20:24</time>
56
+ <contents><target name="magecommunity"><dir name="RevenueConduit"><dir name="RevenueConduit"><dir name="Helper"><file name="Data.php" hash="0a9af814ed12bb85b1be2b0cdff4c864"/></dir><dir name="Model"><dir name="Catalog"><dir name="Product"><dir name="Api"><file name="V2.php" hash="08cea5d6c1a35dffd185677aeec60306"/></dir></dir></dir><dir name="Customer"><dir name="Customer"><dir name="Api"><file name="V2.php" hash="fd835f965fd45b7bfccdb91b0a7bb90e"/></dir></dir></dir><file name="Observer.php" hash="07f339a9959096c4bd40cbaad99f2355"/><dir name="Sales"><dir name="Order"><dir name="Api"><dir name="1.6"><file name="V2.php" hash="7158678bb9e973b72091290218cadc36"/></dir><file name="V2.php" hash="2ff422d550dec4bb1258d31f06a817bb"/></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="35003c5a8ab78a359bf0f114180a6741"/></dir><dir name="etc"><file name="api.xml" hash="83ff3cb817751a0c40cbbfcb0e3df17e"/><file name="config.xml" hash="89d7a21e5b3838fabeb5490472b6e7a2"/><file name="system.xml" hash="357e5c0b20a346777a2b49e219e26102"/><file name="wsdl.xml" hash="053d171231a969b5f288c2af01abd00f"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="RevenueConduit_RevenueConduit.xml" hash="8f594907ef70890af5f90fc16dd59ca7"/></dir></target></contents>
57
+ <compatible/>
58
+ <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
59
+ </package>