Shopgo_Totango - Version 1.0.1

Version Notes


  • Fix some minor issues

  • Add some comments to the code

Download this release

Release Info

Developer Moe Ghashim
Extension Shopgo_Totango
Version 1.0.1
Comparing to
See all releases


Code changes from version 1.0.0 to 1.0.1

app/code/community/Shopgo/Totango/Helper/Data.php CHANGED
@@ -147,8 +147,6 @@ class Shopgo_Totango_Helper_Data extends Shopgo_Core_Helper_Abstract
147
 
148
  switch ($trackersActive) {
149
  case self::TRACKERS_ACTIVE_NONE:
150
- $result = false;
151
-
152
  $this->log(array(
153
  'message' => 'All trackers are inactive/disabled',
154
  'level' => 5
@@ -167,7 +165,7 @@ class Shopgo_Totango_Helper_Data extends Shopgo_Core_Helper_Abstract
167
  break;
168
 
169
  default:
170
- $trackers = self::getTrackers();
171
 
172
  if (isset($trackers[$tracker])) {
173
  $result = $this->getConfig(
@@ -323,6 +321,8 @@ class Shopgo_Totango_Helper_Data extends Shopgo_Core_Helper_Abstract
323
  ));
324
 
325
  if (trim($config) != '') {
 
 
326
  break;
327
  }
328
  } else {
@@ -336,8 +336,6 @@ class Shopgo_Totango_Helper_Data extends Shopgo_Core_Helper_Abstract
336
  ));
337
  }
338
 
339
- // Break is omitted on purpose
340
-
341
  case false:
342
  // It looks a bit odd, but this is a necessary check
343
  if (!$persistLocal->hasFile) {
@@ -354,7 +352,7 @@ class Shopgo_Totango_Helper_Data extends Shopgo_Core_Helper_Abstract
354
  } else {
355
  $this->log(array(
356
  'message' => sprintf(
357
- 'Persist config "local" path (%s) ' .
358
  'is invalid or does not exist',
359
  $path
360
  ),
147
 
148
  switch ($trackersActive) {
149
  case self::TRACKERS_ACTIVE_NONE:
 
 
150
  $this->log(array(
151
  'message' => 'All trackers are inactive/disabled',
152
  'level' => 5
165
  break;
166
 
167
  default:
168
+ $trackers = array_flip(self::getTrackers());
169
 
170
  if (isset($trackers[$tracker])) {
171
  $result = $this->getConfig(
321
  ));
322
 
323
  if (trim($config) != '') {
324
+ // Break only if a persist config "local"
325
+ // value is found.
326
  break;
327
  }
328
  } else {
336
  ));
337
  }
338
 
 
 
339
  case false:
340
  // It looks a bit odd, but this is a necessary check
341
  if (!$persistLocal->hasFile) {
352
  } else {
353
  $this->log(array(
354
  'message' => sprintf(
355
+ 'Persist config path (%s) ' .
356
  'is invalid or does not exist',
357
  $path
358
  ),
app/code/community/Shopgo/Totango/Model/Observer.php CHANGED
@@ -59,9 +59,7 @@ class Shopgo_Totango_Model_Observer
59
  return;
60
  }
61
 
62
- $orderStatesNames = array_keys($orderStates);
63
-
64
- if (!isset($orderStatesNames[$orderState])) {
65
  $helper->log(array(
66
  'message' => sprintf(
67
  '%s orders are not trackable',
@@ -75,6 +73,9 @@ class Shopgo_Totango_Model_Observer
75
 
76
  foreach ($orderStates as $state => $data) {
77
  if ($helper->isTrackerEnabled($data['tracker-name'])) {
 
 
 
78
  $orders = Mage::getModel('sales/order')
79
  ->getCollection()
80
  ->addAttributeToFilter('status', array(
@@ -160,6 +161,8 @@ class Shopgo_Totango_Model_Observer
160
  ->getCollection()
161
  ->getAllIds();
162
 
 
 
163
  if (!isset($categories[$categoryId])) {
164
  $categoriesCount = Mage::getModel('catalog/category')
165
  ->getCollection()->getSize();
@@ -330,7 +333,9 @@ class Shopgo_Totango_Model_Observer
330
  $adminUser = $observer->getUser();
331
  $adminUsername = $adminUser->getUsername();
332
 
333
- $excludedAdminUsers = $helper->getExcludedAdminUsers();
 
 
334
 
335
  if (!isset($excludedAdminUsers[$adminUsername])) {
336
  // New login is not counted in this event.
59
  return;
60
  }
61
 
62
+ if (!isset($orderStates[$orderState])) {
 
 
63
  $helper->log(array(
64
  'message' => sprintf(
65
  '%s orders are not trackable',
73
 
74
  foreach ($orderStates as $state => $data) {
75
  if ($helper->isTrackerEnabled($data['tracker-name'])) {
76
+ // The following line which is used inside
77
+ // a for loop is a bit expensive!
78
+ // I might look for a possible workaround later.
79
  $orders = Mage::getModel('sales/order')
80
  ->getCollection()
81
  ->addAttributeToFilter('status', array(
161
  ->getCollection()
162
  ->getAllIds();
163
 
164
+ $categories = array_flip($categories);
165
+
166
  if (!isset($categories[$categoryId])) {
167
  $categoriesCount = Mage::getModel('catalog/category')
168
  ->getCollection()->getSize();
333
  $adminUser = $observer->getUser();
334
  $adminUsername = $adminUser->getUsername();
335
 
336
+ $excludedAdminUsers = array_flip(
337
+ $helper->getExcludedAdminUsers()
338
+ );
339
 
340
  if (!isset($excludedAdminUsers[$adminUsername])) {
341
  // New login is not counted in this event.
app/code/community/Shopgo/Totango/etc/config.xml CHANGED
@@ -24,7 +24,7 @@
24
  <config>
25
  <modules>
26
  <Shopgo_Totango>
27
- <version>1.0.0</version>
28
  </Shopgo_Totango>
29
  </modules>
30
  <global>
24
  <config>
25
  <modules>
26
  <Shopgo_Totango>
27
+ <version>1.0.1</version>
28
  </Shopgo_Totango>
29
  </modules>
30
  <global>
package.xml CHANGED
@@ -1,27 +1,28 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Shopgo_Totango</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Totango is a module that integrates Magento with Totango tracking service.</summary>
10
- <description>&lt;p&gt;Totango module integrates Magento with Totango tracking service.&lt;/p&gt;&#xD;
11
- &lt;h3&gt;What is Totango?&lt;/h3&gt;&#xD;
12
- &lt;p&gt;Totango is the leading Customer Engagement platform that helps SaaS companies create an active and engaged user base.&lt;/p&gt;&#xD;
13
  &lt;p&gt;Totango is built on the idea that customer success is all about understanding, measuring, and delivering business value to customers. To do this, Totango&#x2019;s platform is focused on identifying and monitoring &#x201C;leading indicators&#x201D; that help SaaS companies predict at-risk customers and proactively drive positive customer experiences.&lt;/p&gt;&#xD;
14
  &lt;p&gt;Totango pulls in data from multiple systems to assemble a rich profile of every customer, including a predictive health rating and an &#x201C;engagement score,&#x201D; which is computed based on data science and machine learning.&lt;/p&gt;&#xD;
15
  &lt;h3&gt;How does it work?&lt;/h3&gt;&#xD;
16
- &lt;p&gt;Totango module tracks the following activities on Magento and sends tracking data to Totango:&lt;/p&gt;&#xD;
 
 
17
  &lt;ul&gt;&#xD;
18
- &lt;li&gt;Track completed and canceled orders.&lt;/li&gt;&#xD;
19
  &lt;li&gt;Track new products.&lt;/li&gt;&#xD;
20
  &lt;li&gt;Track new categories.&lt;/li&gt;&#xD;
21
  &lt;li&gt;Track new attributes.&lt;/li&gt;&#xD;
22
- &lt;li&gt;Track enabled couriers.&lt;/li&gt;&#xD;
23
  &lt;li&gt;Track enabled payment methods.&lt;/li&gt;&#xD;
24
  &lt;li&gt;Track successful admin logins.&lt;/li&gt;&#xD;
 
25
  &lt;/ul&gt;&#xD;
26
  &lt;h3&gt;Dependencies&lt;/h3&gt;&#xD;
27
  &lt;ul&gt;&#xD;
@@ -30,19 +31,23 @@
30
  &lt;h3&gt;Notes&lt;/h3&gt;&#xD;
31
  &lt;ul&gt;&#xD;
32
  &lt;li&gt;Make sure that all dependencies mentioned above are installed before installing this module. Otherwise, it won't work.&lt;/li&gt;&#xD;
33
- &lt;li&gt;More trackers will be added in the future.&lt;/li&gt;&#xD;
34
  &lt;li&gt;You could customize this module and add your own trackers.&lt;/li&gt;&#xD;
35
  &lt;li&gt;You could use/call this module's helper functions to send tracking calls to Totango.&lt;/li&gt;&#xD;
 
36
  &lt;/ul&gt;&#xD;
37
  &lt;p&gt;&lt;strong&gt;You could also get the latest version of this module from:&lt;/strong&gt;&lt;br /&gt;&#xD;
38
- &lt;a href="https://github.com/shopgo-me/magento-totango-integration"&gt;https://github.com/shopgo-me/magento-totango-integration&lt;/a&gt;&lt;/p&gt;&#xD;
39
  &lt;p&gt;&lt;strong&gt;For more info about Totango, visit this website:&lt;/strong&gt;&lt;br /&gt;&#xD;
40
  &lt;a href="http://www.totango.com/"&gt;http://www.totango.com/&lt;/a&gt;&lt;/p&gt;</description>
41
- <notes>First release</notes>
 
 
 
42
  <authors><author><name>ShopGo</name><user>ShopGo</user><email>support@shopgo.me</email></author></authors>
43
- <date>2015-09-17</date>
44
- <time>11:53:14</time>
45
- <contents><target name="magecommunity"><dir name="Shopgo"><dir name="Totango"><dir name="Helper"><file name="Data.php" hash="a107cbb74469eca6615569909a451987"/></dir><dir name="Model"><file name="Observer.php" hash="ce92c2fe886651c13ec4f2bb6e9d42d3"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Trackersactive.php" hash="7e053d45fd62a4492938dfb006c28c5b"/></dir></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="067f7c3c9b06c50d95c72e392f6b7325"/><file name="config.xml" hash="3a00c0f23dfdca5ec9af05cb4f94f2bb"/><file name="system.xml" hash="d83a1e7718af2a8ccfda6dd0f4fd1f1c"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Shopgo_Totango.xml" hash="057d7edbb264eebeaabb61ba002338a9"/></dir></target></contents>
46
  <compatible/>
47
  <dependencies><required><php><min>5.3.0</min><max>7.0.0</max></php><package><name>Shopgo_Core</name><channel>community</channel><min>1.0.7</min><max/></package></required></dependencies>
48
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Shopgo_Totango</name>
4
+ <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Totango is a module that integrates Magento with Totango tracking service.</summary>
10
+ <description>&lt;p&gt;Totango is the leading Customer Engagement platform that helps SaaS companies create an active and engaged user base.&lt;/p&gt;&#xD;
 
 
11
  &lt;p&gt;Totango is built on the idea that customer success is all about understanding, measuring, and delivering business value to customers. To do this, Totango&#x2019;s platform is focused on identifying and monitoring &#x201C;leading indicators&#x201D; that help SaaS companies predict at-risk customers and proactively drive positive customer experiences.&lt;/p&gt;&#xD;
12
  &lt;p&gt;Totango pulls in data from multiple systems to assemble a rich profile of every customer, including a predictive health rating and an &#x201C;engagement score,&#x201D; which is computed based on data science and machine learning.&lt;/p&gt;&#xD;
13
  &lt;h3&gt;How does it work?&lt;/h3&gt;&#xD;
14
+ &lt;p&gt;The module's job is to monitor and track some users' activities on Magento (e.g. Adding Products, Canceling Orders, ...etc.) and sends tracking data to Totango.&lt;/p&gt;&#xD;
15
+ &lt;p&gt;It does not have any front end interface, and all of its work is done in the background without noticing it.&lt;/p&gt;&#xD;
16
+ &lt;h3&gt;Features&lt;/h3&gt;&#xD;
17
  &lt;ul&gt;&#xD;
18
+ &lt;li&gt;Track complete and canceled orders.&lt;/li&gt;&#xD;
19
  &lt;li&gt;Track new products.&lt;/li&gt;&#xD;
20
  &lt;li&gt;Track new categories.&lt;/li&gt;&#xD;
21
  &lt;li&gt;Track new attributes.&lt;/li&gt;&#xD;
22
+ &lt;li&gt;Track enabled shipping methods.&lt;/li&gt;&#xD;
23
  &lt;li&gt;Track enabled payment methods.&lt;/li&gt;&#xD;
24
  &lt;li&gt;Track successful admin logins.&lt;/li&gt;&#xD;
25
+ &lt;li&gt;Server/Backend Integration (HTTP API).&lt;/li&gt;&#xD;
26
  &lt;/ul&gt;&#xD;
27
  &lt;h3&gt;Dependencies&lt;/h3&gt;&#xD;
28
  &lt;ul&gt;&#xD;
31
  &lt;h3&gt;Notes&lt;/h3&gt;&#xD;
32
  &lt;ul&gt;&#xD;
33
  &lt;li&gt;Make sure that all dependencies mentioned above are installed before installing this module. Otherwise, it won't work.&lt;/li&gt;&#xD;
34
+ &lt;li&gt;More trackers could be added in the future.&lt;/li&gt;&#xD;
35
  &lt;li&gt;You could customize this module and add your own trackers.&lt;/li&gt;&#xD;
36
  &lt;li&gt;You could use/call this module's helper functions to send tracking calls to Totango.&lt;/li&gt;&#xD;
37
+ &lt;li&gt;Totango Javascript Collector is currently not supported.&lt;/li&gt;&#xD;
38
  &lt;/ul&gt;&#xD;
39
  &lt;p&gt;&lt;strong&gt;You could also get the latest version of this module from:&lt;/strong&gt;&lt;br /&gt;&#xD;
40
+ &lt;a href="https://github.com/shopgo-magento1/magento-totango-integration"&gt;https://github.com/shopgo-magento1/magento-totango-integration&lt;/a&gt;&lt;/p&gt;&#xD;
41
  &lt;p&gt;&lt;strong&gt;For more info about Totango, visit this website:&lt;/strong&gt;&lt;br /&gt;&#xD;
42
  &lt;a href="http://www.totango.com/"&gt;http://www.totango.com/&lt;/a&gt;&lt;/p&gt;</description>
43
+ <notes>&lt;ul&gt;&#xD;
44
+ &lt;li&gt;Fix some minor issues&lt;/li&gt;&#xD;
45
+ &lt;li&gt;Add some comments to the code&lt;/li&gt;&#xD;
46
+ &lt;/ul&gt;</notes>
47
  <authors><author><name>ShopGo</name><user>ShopGo</user><email>support@shopgo.me</email></author></authors>
48
+ <date>2015-10-01</date>
49
+ <time>09:41:50</time>
50
+ <contents><target name="magecommunity"><dir name="Shopgo"><dir name="Totango"><dir name="Helper"><file name="Data.php" hash="2cc1642ab73fd90e5b77ed1e87667bd4"/></dir><dir name="Model"><file name="Observer.php" hash="003f9eda67ecce9ca3efc160fafcc54c"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Trackersactive.php" hash="7e053d45fd62a4492938dfb006c28c5b"/></dir></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="067f7c3c9b06c50d95c72e392f6b7325"/><file name="config.xml" hash="501b27695186db8c4edff6a2fb23641d"/><file name="system.xml" hash="d83a1e7718af2a8ccfda6dd0f4fd1f1c"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Shopgo_Totango.xml" hash="057d7edbb264eebeaabb61ba002338a9"/></dir></target></contents>
51
  <compatible/>
52
  <dependencies><required><php><min>5.3.0</min><max>7.0.0</max></php><package><name>Shopgo_Core</name><channel>community</channel><min>1.0.7</min><max/></package></required></dependencies>
53
  </package>