Eyemagine_HubSpot - Version 1.1.5

Version Notes

v.1.1.5: Sep 8, 2016

- Fixed product and media url for multistores.
- Optimized performance for order data.

Download this release

Release Info

Developer EYEMAGINE
Extension Eyemagine_HubSpot
Version 1.1.5
Comparing to
See all releases


Code changes from version 1.1.4 to 1.1.5

app/code/community/Eyemagine/HubSpot/Helper/Data.php CHANGED
@@ -61,6 +61,27 @@ class Eyemagine_HubSpot_Helper_Data extends Mage_Core_Helper_Abstract
61
  return $result;
62
  }
63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
 
65
  /**
66
  * Convert the object values to associative array
61
  return $result;
62
  }
63
 
64
+ /**
65
+ * Get stores data
66
+ *
67
+ * @return array
68
+ */
69
+ public function getStores()
70
+ {
71
+ foreach (Mage::app()->getStores(true, true) as $store) {
72
+
73
+ $storeId = $store->getId();
74
+
75
+ $result[$storeId] = array(
76
+ 'store_id' => $storeId,
77
+ 'website_id' => $store->getWebsiteId(),
78
+ 'store_url' => $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB),
79
+ 'media_url' => $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)
80
+ );
81
+ }
82
+ return $result;
83
+ }
84
+
85
 
86
  /**
87
  * Convert the object values to associative array
app/code/community/Eyemagine/HubSpot/controllers/SyncController.php CHANGED
@@ -142,10 +142,11 @@ class Eyemagine_HubSpot_SyncController extends Mage_Core_Controller_Front_Action
142
  $entityId = $request->getParam('id', '0');
143
  $websiteId = Mage::app()->getWebsite()->getId();
144
  $store = Mage::app()->getStore();
 
145
  $storeId = Mage::app()->getStore()->getId();
146
  $custGroups = $helper->getCustomerGroups();
147
  $collection = Mage::getModel('sales/order')->getCollection();
148
- $ordersData = array();
149
 
150
  // setup the query and page size
151
  $collection->addFieldToFilter('updated_at', array(
@@ -171,9 +172,9 @@ class Eyemagine_HubSpot_SyncController extends Mage_Core_Controller_Front_Action
171
  $groupId = (int)$order->getCustomerGroupId();
172
 
173
  $result['customer_group'] = (isset($custGroups[$groupId])) ? $custGroups[$groupId] : 'Guest';
174
- $result['website_id'] = $websiteId;
175
- $result['store_url'] = $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
176
- $result['media_url'] = $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
177
  $result['shipping_address'] = $helper->convertAttributeData($order->getShippingAddress());
178
  $result['billing_address'] = $helper->convertAttributeData($order->getBillingAddress());
179
  $result['items'] = array();
@@ -196,8 +197,7 @@ class Eyemagine_HubSpot_SyncController extends Mage_Core_Controller_Front_Action
196
 
197
  $this->_outputJson(array(
198
  'orders' => $ordersData,
199
- 'website' => $websiteId,
200
- 'store' => $storeId
201
  ));
202
  }
203
 
@@ -290,6 +290,7 @@ class Eyemagine_HubSpot_SyncController extends Mage_Core_Controller_Front_Action
290
  $end = date('Y-m-d H:i:s', time() - $request->getParam('offset', self::IS_ABANDONED_IN_SECS));
291
  $websiteId = Mage::app()->getWebsite()->getId();
292
  $store = Mage::app()->getStore();
 
293
  $storeId = Mage::app()->getStore()->getId();
294
  $custGroups = $helper->getCustomerGroups();
295
  $collection = Mage::getModel('sales/quote')->getCollection();
@@ -322,10 +323,10 @@ class Eyemagine_HubSpot_SyncController extends Mage_Core_Controller_Front_Action
322
  $result['customer_group'] = 'Guest';
323
  }
324
 
325
- $result['website_id'] = $websiteId;
326
- $result['store_url'] = $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
327
- $result['media_url'] = $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
328
- $result['shipping_address'] = $helper->convertAttributeData($cart->getShippingAddress());
329
  $result['billing_address'] = $helper->convertAttributeData($cart->getBillingAddress());
330
  $result['items'] = array();
331
 
@@ -360,8 +361,7 @@ class Eyemagine_HubSpot_SyncController extends Mage_Core_Controller_Front_Action
360
 
361
  $this->_outputJson(array(
362
  'abandoned' => $returnData,
363
- 'website' => $websiteId,
364
- 'store' => $storeId
365
  ));
366
  }
367
  /**
142
  $entityId = $request->getParam('id', '0');
143
  $websiteId = Mage::app()->getWebsite()->getId();
144
  $store = Mage::app()->getStore();
145
+ $stores = $helper->getStores();
146
  $storeId = Mage::app()->getStore()->getId();
147
  $custGroups = $helper->getCustomerGroups();
148
  $collection = Mage::getModel('sales/order')->getCollection();
149
+ $ordersData = array();
150
 
151
  // setup the query and page size
152
  $collection->addFieldToFilter('updated_at', array(
172
  $groupId = (int)$order->getCustomerGroupId();
173
 
174
  $result['customer_group'] = (isset($custGroups[$groupId])) ? $custGroups[$groupId] : 'Guest';
175
+ $result['website_id'] = (isset($stores[$result['store_id']]['website_id']))? $stores[$result['store_id']]['website_id']: $websiteId;
176
+ $result['store_url'] = (isset($stores[$result['store_id']]['store_url']))? $stores[$result['store_id']]['store_url']: $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
177
+ $result['media_url'] = (isset($stores[$result['store_id']]['media_url']))? $stores[$result['store_id']]['media_url']:$store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
178
  $result['shipping_address'] = $helper->convertAttributeData($order->getShippingAddress());
179
  $result['billing_address'] = $helper->convertAttributeData($order->getBillingAddress());
180
  $result['items'] = array();
197
 
198
  $this->_outputJson(array(
199
  'orders' => $ordersData,
200
+ 'stores' => $stores
 
201
  ));
202
  }
203
 
290
  $end = date('Y-m-d H:i:s', time() - $request->getParam('offset', self::IS_ABANDONED_IN_SECS));
291
  $websiteId = Mage::app()->getWebsite()->getId();
292
  $store = Mage::app()->getStore();
293
+ $stores = $helper->getStores();
294
  $storeId = Mage::app()->getStore()->getId();
295
  $custGroups = $helper->getCustomerGroups();
296
  $collection = Mage::getModel('sales/quote')->getCollection();
323
  $result['customer_group'] = 'Guest';
324
  }
325
 
326
+ $result['website_id'] = (isset($stores[$result['store_id']]['website_id']))? $stores[$result['store_id']]['website_id']: $websiteId;
327
+ $result['store_url'] = (isset($stores[$result['store_id']]['store_url']))? $stores[$result['store_id']]['store_url']: $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
328
+ $result['media_url'] = (isset($stores[$result['store_id']]['media_url']))? $stores[$result['store_id']]['media_url']:$store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
329
+ $result['shipping_address'] = $helper->convertAttributeData($cart->getShippingAddress());
330
  $result['billing_address'] = $helper->convertAttributeData($cart->getBillingAddress());
331
  $result['items'] = array();
332
 
361
 
362
  $this->_outputJson(array(
363
  'abandoned' => $returnData,
364
+ 'stores' => $stores
 
365
  ));
366
  }
367
  /**
app/code/community/Eyemagine/HubSpot/etc/config.xml CHANGED
@@ -15,7 +15,7 @@
15
  <config>
16
  <modules>
17
  <Eyemagine_HubSpot>
18
- <version>1.1.4</version>
19
  </Eyemagine_HubSpot>
20
  </modules>
21
  <global>
15
  <config>
16
  <modules>
17
  <Eyemagine_HubSpot>
18
+ <version>1.1.5</version>
19
  </Eyemagine_HubSpot>
20
  </modules>
21
  <global>
app/code/community/Eyemagine/HubSpot/readme.txt CHANGED
@@ -43,6 +43,34 @@ COMPATIBILITY:
43
  -------------------------------------------------------------------------------
44
  RELEASE NOTES:
45
  -------------------------------------------------------------------------------
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
  v.1.0.2: July 7, 2014
48
  - Added redirects for invisible simple products
43
  -------------------------------------------------------------------------------
44
  RELEASE NOTES:
45
  -------------------------------------------------------------------------------
46
+ v.1.1.5: Sep 8, 2016
47
+ - Fixed product and media url for multistores.
48
+ - Optimized performance for order data.
49
+
50
+ v.1.1.4: July 5, 2016:
51
+ - Added workaround for syncing data without timestamp.
52
+
53
+ v.1.1.3: June 14, 2016:
54
+ - Fixed performance issue for abandoned cart data.
55
+ - Fixed notification message for unavailable products.
56
+ - Added multi-store support.
57
+
58
+ v.1.1.2: Dec 04, 2015:
59
+ - Fixed wishlist syncing.
60
+ - Fixed newsletter syncing.
61
+
62
+ v.1.1.1: Oct 05, 2015:
63
+ - Fixed 404 error message.
64
+
65
+ v.1.1.0: Sep 11, 2015:
66
+ - Added sync for newsletter subscribers.
67
+ - Fixed sync for the address data.
68
+
69
+ v.1.0.5: Aug 31, 2015:
70
+ - Fixed product image display related issue
71
+
72
+ v.1.0.3: July 7, 2014
73
+ - Fixed package definition
74
 
75
  v.1.0.2: July 7, 2014
76
  - Added redirects for invisible simple products
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Eyemagine_HubSpot</name>
4
- <version>1.1.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.eyemaginetech.com/license">Custom</license>
7
  <channel>community</channel>
@@ -49,13 +49,14 @@ HubSpot's Social Inbox and Smart Content tools help you break out of the inbox a
49
  Attribute revenue generated to specific marketing channels and campaigns.&#xD;
50
  &#xD;
51
  HubSpot's suite of analytics and reporting tools allows you to quickly and easily see which traffic sources or marketing actions turned into revenue for you during any given time period. Generate a report in seconds and email it to anyone in the company--you can even set up recurring reports so everyone can keep track of the company's progress.</description>
52
- <notes>v.1.1.4: July 5, 2016:&#xD;
53
  &#xD;
54
- - Added workaround for syncing data without timestamp.</notes>
 
55
  <authors><author><name>EYEMAGINE</name><user>eyemagine</user><email>andy@eyemaginetech.com</email></author></authors>
56
- <date>2016-07-05</date>
57
- <time>18:42:14</time>
58
- <contents><target name="magecommunity"><dir name="Eyemagine"><dir name="HubSpot"><dir name="Block"><dir name="Adminhtml"><dir name="Frontend"><dir name="Button"><file name="Regen.php" hash="da45b06b8577c597efd5d21954da7338"/><file name="._Regen.php" hash="03ec92c7aa4a80b83dab35ae888c547b"/></dir><dir name="Eyemagine"><file name="Info.php" hash="241764d8a2ef0cea19590ed1e278459f"/><file name="Support.php" hash="af9992b0108aa1b45f847cd00dfde88d"/><file name="Version.php" hash="7e587492716799a25b9a9c8a898d872a"/><file name="._Info.php" hash="ce0cf7ed20da8016624555bbb5968191"/><file name="._Support.php" hash="d7af6eacee8bbc688f3be8c5b681b7bb"/><file name="._Version.php" hash="aa0f9e438f113f370a375ec75e45dfdc"/></dir><file name="Utk.php" hash="ae331d527c62a9afc50dabc05dfda90f"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="2423f44330c02255169ff6776ae76e6b"/></dir><dir name="Model"><file name="Observer.php" hash="b6324baf056a15b740db37596174c8e6"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Hubspot"><file name="IndexController.php" hash="ce74c1cbb68569a834c55e530884fdf3"/></dir></dir><file name="LinkController.php" hash="ae5c25108f9dd6a72d379e98137c1637"/><file name="SyncController.php" hash="49491cae2368318c476dd5fecb2bfc63"/></dir><dir name="etc"><file name="adminhtml.xml" hash="30c1e3594efb50975820d190c6152122"/><file name="config.xml" hash="a36033a5232b5c3f2b86510c424b215e"/><file name="system.xml" hash="e0d5b580d7094942555662d527c02dbc"/></dir><file name="readme.txt" hash="b159196e6f2ce61c9deb1615a4cd8095"/><dir name="sql"><dir name="eyehubspot_setup"><file name="mysql4-install-1.0.0.php" hash="a0f5a0a9fa39c641c70771ba1056be80"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Eyemagine_HubSpot.xml" hash="0442e65d79b182a43b1cdb58e95e6e36"/></dir></target></contents>
59
  <compatible/>
60
  <dependencies><required><php><min>5.3.0</min><max>7.0.0</max></php></required></dependencies>
61
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Eyemagine_HubSpot</name>
4
+ <version>1.1.5</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.eyemaginetech.com/license">Custom</license>
7
  <channel>community</channel>
49
  Attribute revenue generated to specific marketing channels and campaigns.&#xD;
50
  &#xD;
51
  HubSpot's suite of analytics and reporting tools allows you to quickly and easily see which traffic sources or marketing actions turned into revenue for you during any given time period. Generate a report in seconds and email it to anyone in the company--you can even set up recurring reports so everyone can keep track of the company's progress.</description>
52
+ <notes>v.1.1.5: Sep 8, 2016&#xD;
53
  &#xD;
54
+ - Fixed product and media url for multistores.&#xD;
55
+ - Optimized performance for order data.</notes>
56
  <authors><author><name>EYEMAGINE</name><user>eyemagine</user><email>andy@eyemaginetech.com</email></author></authors>
57
+ <date>2016-09-08</date>
58
+ <time>04:03:25</time>
59
+ <contents><target name="magecommunity"><dir name="Eyemagine"><dir name="HubSpot"><dir name="Block"><dir name="Adminhtml"><dir name="Frontend"><dir name="Button"><file name="Regen.php" hash="da45b06b8577c597efd5d21954da7338"/><file name="._Regen.php" hash="03ec92c7aa4a80b83dab35ae888c547b"/></dir><dir name="Eyemagine"><file name="Info.php" hash="241764d8a2ef0cea19590ed1e278459f"/><file name="Support.php" hash="af9992b0108aa1b45f847cd00dfde88d"/><file name="Version.php" hash="7e587492716799a25b9a9c8a898d872a"/><file name="._Info.php" hash="ce0cf7ed20da8016624555bbb5968191"/><file name="._Support.php" hash="d7af6eacee8bbc688f3be8c5b681b7bb"/><file name="._Version.php" hash="aa0f9e438f113f370a375ec75e45dfdc"/></dir><file name="Utk.php" hash="ae331d527c62a9afc50dabc05dfda90f"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="cc6014234951c776d8bf5b40bca813ee"/></dir><dir name="Model"><file name="Observer.php" hash="b6324baf056a15b740db37596174c8e6"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Hubspot"><file name="IndexController.php" hash="ce74c1cbb68569a834c55e530884fdf3"/></dir></dir><file name="LinkController.php" hash="ae5c25108f9dd6a72d379e98137c1637"/><file name="SyncController.php" hash="b33a57535bb69c7dad12da033cdd508d"/></dir><dir name="etc"><file name="adminhtml.xml" hash="30c1e3594efb50975820d190c6152122"/><file name="config.xml" hash="55723e534df589118e07a584676bdc11"/><file name="system.xml" hash="e0d5b580d7094942555662d527c02dbc"/></dir><file name="readme.txt" hash="46d7232c6d3f5a9a8a5bf444e5ac3783"/><dir name="sql"><dir name="eyehubspot_setup"><file name="mysql4-install-1.0.0.php" hash="a0f5a0a9fa39c641c70771ba1056be80"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Eyemagine_HubSpot.xml" hash="0442e65d79b182a43b1cdb58e95e6e36"/></dir></target></contents>
60
  <compatible/>
61
  <dependencies><required><php><min>5.3.0</min><max>7.0.0</max></php></required></dependencies>
62
  </package>