Ometria_Magento_Extension - Version 1.1.1

Version Notes

Better multi store ping support and better newsletter support.

Download this release

Release Info

Developer Alastair James
Extension Ometria_Magento_Extension
Version 1.1.1
Comparing to
See all releases


Code changes from version 1.1.0 to 1.1.1

app/code/community/Ometria/AbandonedCarts/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Ometria_AbandonedCarts>
5
- <version>1.1.0</version>
6
  </Ometria_AbandonedCarts>
7
  </modules>
8
 
2
  <config>
3
  <modules>
4
  <Ometria_AbandonedCarts>
5
+ <version>1.1.1</version>
6
  </Ometria_AbandonedCarts>
7
  </modules>
8
 
app/code/community/Ometria/Api/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Ometria_Api>
5
- <version>1.1.0</version>
6
  </Ometria_Api>
7
  </modules>
8
 
2
  <config>
3
  <modules>
4
  <Ometria_Api>
5
+ <version>1.1.1</version>
6
  </Ometria_Api>
7
  </modules>
8
 
app/code/community/Ometria/Core/Helper/Config.php CHANGED
@@ -23,8 +23,12 @@ class Ometria_Core_Helper_Config extends Mage_Core_Helper_Abstract {
23
  return Mage::getStoreConfigFlag('ometria/advanced/scriptload');
24
  }
25
 
26
- public function getAPIKey() {
27
- return Mage::getStoreConfig('ometria/general/apikey');
 
 
 
 
28
  }
29
 
30
  public function isConfigured() {
23
  return Mage::getStoreConfigFlag('ometria/advanced/scriptload');
24
  }
25
 
26
+ public function getAPIKey($store_id=null) {
27
+ if ($store_id) {
28
+ return Mage::getStoreConfig('ometria/general/apikey', $store_id);
29
+ } else {
30
+ return Mage::getStoreConfig('ometria/general/apikey');
31
+ }
32
  }
33
 
34
  public function isConfigured() {
app/code/community/Ometria/Core/Helper/Ping.php CHANGED
@@ -7,7 +7,7 @@ class Ometria_Core_Helper_Ping extends Mage_Core_Helper_Abstract {
7
  const API_PATH = '/ping.php';
8
  const API_SOCKET_TIMEOUT = 2;
9
 
10
- public function sendPing($type, $ids, $extra=array()){
11
  $ometriaConfigHelper = Mage::helper('ometria/config');
12
 
13
  if (!$ometriaConfigHelper->isConfigured()) {
@@ -26,7 +26,7 @@ class Ometria_Core_Helper_Ping extends Mage_Core_Helper_Abstract {
26
  }
27
  }
28
 
29
- $extra['account'] = $ometriaConfigHelper->getAPIKey();
30
  $extra['type'] = $type;
31
  $extra['id'] = $ids;
32
 
7
  const API_PATH = '/ping.php';
8
  const API_SOCKET_TIMEOUT = 2;
9
 
10
+ public function sendPing($type, $ids, $extra=array(), $store_id=null){
11
  $ometriaConfigHelper = Mage::helper('ometria/config');
12
 
13
  if (!$ometriaConfigHelper->isConfigured()) {
26
  }
27
  }
28
 
29
+ $extra['account'] = $ometriaConfigHelper->getAPIKey($store_id);
30
  $extra['type'] = $type;
31
  $extra['id'] = $ids;
32
 
app/code/community/Ometria/Core/Model/Observer/Cart.php CHANGED
@@ -68,7 +68,7 @@ class Ometria_Core_Model_Observer_Cart {
68
  $order = $observer->getEvent()->getOrder();
69
  $session_id = $ometria_session_helper->getSessionId();
70
  if ($session_id) {
71
- $ometria_ping_helper->sendPing('transaction', $order->getIncrementId(), array('session'=>$session_id));
72
  }
73
  $ometria_cookiechannel_helper->addCommand(array('trans', $order->getIncrementId()));
74
 
68
  $order = $observer->getEvent()->getOrder();
69
  $session_id = $ometria_session_helper->getSessionId();
70
  if ($session_id) {
71
+ $ometria_ping_helper->sendPing('transaction', $order->getIncrementId(), array('session'=>$session_id), $order->store_id);
72
  }
73
  $ometria_cookiechannel_helper->addCommand(array('trans', $order->getIncrementId()));
74
 
app/code/community/Ometria/Core/Model/Observer/Customer.php CHANGED
@@ -8,7 +8,7 @@ class Ometria_Core_Model_Observer_Customer {
8
 
9
  $ometria_ping_helper = Mage::helper('ometria/ping');
10
  $order = $observer->getEvent()->getCustomer();
11
- $ometria_ping_helper->sendPing('customer', $order->getId());
12
 
13
  return $this;
14
  }
8
 
9
  $ometria_ping_helper = Mage::helper('ometria/ping');
10
  $order = $observer->getEvent()->getCustomer();
11
+ $ometria_ping_helper->sendPing('customer', $order->getId(), array(), $customer->store_id);
12
 
13
  return $this;
14
  }
app/code/community/Ometria/Core/Model/Observer/Newsletter.php CHANGED
@@ -7,14 +7,20 @@ class Ometria_Core_Model_Observer_Newsletter {
7
  $subscriber = $observer->getEvent()->getSubscriber();
8
 
9
  $data = $subscriber->getData();
10
- $status_change = $subscriber->getIsStatusChanged();
 
 
 
 
 
 
11
 
12
  // Only if status has changed
13
  if ($status_change) {
14
  $event = null;
15
  if ($data['subscriber_status']==1) $event = 'newsletter_subscribed';
16
  if ($data['subscriber_status']==3) $event = 'newsletter_unsubscribed';
17
- if ($event) $ometria_ping_helper->sendPing($event, $subscriber->getEmail(), array('store_id'=>$subscriber->store_id));
18
 
19
  // Update timestamp column
20
  $subscriber->change_status_at = date("Y-m-d H:i:s", time());
@@ -36,6 +42,6 @@ class Ometria_Core_Model_Observer_Newsletter {
36
  $ometria_ping_helper = Mage::helper('ometria/ping');
37
 
38
  $subscriber = $observer->getEvent()->getSubscriber();
39
- $ometria_ping_helper->sendPing('newsletter_unsubscribed', $subscriber->getEmail());
40
  }
41
  }
7
  $subscriber = $observer->getEvent()->getSubscriber();
8
 
9
  $data = $subscriber->getData();
10
+
11
+ $original_data = $subscriber->getOrigData();
12
+ if (!$original_data) {
13
+ $status_change = true;
14
+ } elseif (isset($original_data['subscriber_status'])) {
15
+ $status_change = $data['subscriber_status'] != $original_data['subscriber_status'];
16
+ }
17
 
18
  // Only if status has changed
19
  if ($status_change) {
20
  $event = null;
21
  if ($data['subscriber_status']==1) $event = 'newsletter_subscribed';
22
  if ($data['subscriber_status']==3) $event = 'newsletter_unsubscribed';
23
+ if ($event) $ometria_ping_helper->sendPing($event, $subscriber->getEmail(), array('store_id'=>$subscriber->store_id), $subscriber->store_id);
24
 
25
  // Update timestamp column
26
  $subscriber->change_status_at = date("Y-m-d H:i:s", time());
42
  $ometria_ping_helper = Mage::helper('ometria/ping');
43
 
44
  $subscriber = $observer->getEvent()->getSubscriber();
45
+ $ometria_ping_helper->sendPing('newsletter_unsubscribed', $subscriber->getEmail(), array('store_id'=>$subscriber->store_id), $subscriber->store_id);
46
  }
47
  }
app/code/community/Ometria/Core/Model/Observer/Order.php CHANGED
@@ -12,7 +12,7 @@ class Ometria_Core_Model_Observer_Order {
12
 
13
  $ometria_ping_helper = Mage::helper('ometria/ping');
14
  $order = $observer->getEvent()->getOrder();
15
- $ometria_ping_helper->sendPing('transaction', $order->getIncrementId());
16
 
17
  return $this;
18
  }
12
 
13
  $ometria_ping_helper = Mage::helper('ometria/ping');
14
  $order = $observer->getEvent()->getOrder();
15
+ $ometria_ping_helper->sendPing('transaction', $order->getIncrementId(), array(), $order->store_id);
16
 
17
  return $this;
18
  }
app/code/community/Ometria/Core/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Ometria_Core>
5
- <version>1.1.0</version>
6
  </Ometria_Core>
7
  </modules>
8
 
2
  <config>
3
  <modules>
4
  <Ometria_Core>
5
+ <version>1.1.1</version>
6
  </Ometria_Core>
7
  </modules>
8
 
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Ometria_Magento_Extension</name>
4
- <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Source License (OSL)</license>
7
  <channel>community</channel>
@@ -21,13 +21,11 @@ Enough Data already. Tell me what to do!&#xD;
21
  We don't just pull the right data together in one place, we also create insights. Our team of data scientists have created a set of algorithms to spot weaknesses, under-performance and opportunities, so every time a retailer logs into their dashboards we present a short list of top revenue wins.&#xD;
22
  &#xD;
23
  Whether it's with our multi-dimension funnel analysis which flags up specific channels that may be under-performing, or our customer dashboard which spots channels that deliver customers with the best CLV, our 'actionable insights' come ready to go.</description>
24
- <notes>Additional APIS for coupon code generation and stock levels.&#xD;
25
- &#xD;
26
- Some small fixes around identification and abandoned baskets.</notes>
27
  <authors><author><name>Alastair James</name><user>aljames1981</user><email>al.james@gmail.com</email></author></authors>
28
- <date>2015-09-01</date>
29
- <time>14:14:00</time>
30
- <contents><target name="magecommunity"><dir name="Ometria"><dir name="AbandonedCarts"><dir name="Helper"><file name="Config.php" hash="4ea2f9de193a510a1438a1911f6e9a8d"/><file name="Data.php" hash="1348c35f00b49b2b30034f0d9a819ae8"/></dir><dir name="controllers"><file name="CartlinkController.php" hash="0116b91a5a5ce16319a7665bb4261fe6"/></dir><dir name="etc"><file name="config.xml" hash="4c0890bac2661dc57c2f55da43948c88"/><file name="system.xml" hash="11db59f5c2f864525e4c1cdd06283ac1"/></dir></dir><dir name="Api"><dir name="Helper"><file name="Data.php" hash="8a19a3bf39de93fab7d2e1333c3c0806"/></dir><dir name="Model"><file name="Api.php" hash="4dba56cef3f7d73084e3475cbf37fdbe"/><file name="Api2.php" hash="e34e5530d8e828fcdb2ce09f6abef01d"/><file name="FixedCouponGenerator.php" hash="b37f5df7471dca9437a7aed70b4c53c0"/></dir><dir name="etc"><file name="api.xml" hash="51d02f0154ac396ef90f4ff484253af3"/><file name="config.xml" hash="ab7558111825f13a70d1279d2ab381cc"/></dir></dir><dir name="Core"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Startwizard.php" hash="48c0cc3736f8a7fbd871d92d1aed9a81"/></dir></dir><dir name="Wizard"><file name="Finished.php" hash="3325319ce22b23c3661a15b7ab6cbb83"/><dir name="Start"><file name="Form.php" hash="e5d6f86a9718da044104245b46230674"/></dir><file name="Start.php" hash="befc4575e361b7a9916f929e2fc58c45"/></dir></dir><file name="Head.php" hash="1b00336f0bd24d46c56b6ced4c0515a6"/></dir><dir name="Helper"><file name="Config.php" hash="1a9c4653ff34de123dbab505687265a7"/><file name="Cookiechannel.php" hash="c3751e4e855b6612e2c4c99feeab4c5e"/><file name="Data.php" hash="26c20107047db9e3911118efbf083135"/><file name="Ping.php" hash="0eba99b10b71c666cecd95ddaef69df3"/><file name="Product.php" hash="60e3b6bcb43884af7e4a4ed48c3e3411"/><file name="Session.php" hash="798245d7d20c523b3c386c8bf25979d2"/></dir><dir name="Model"><dir name="Config"><dir name="Source"><file name="Productmode.php" hash="3b37b999e8d49fc23af6229bcae86bb9"/></dir></dir><dir name="Observer"><file name="Cart.php" hash="223544b7fc3717eeaebcadefb7f1344f"/><file name="Customer.php" hash="3e36530a774e2f9af9adbbb581f52380"/><file name="Newsletter.php" hash="ae3f3c645bc6eca8c4e4f33ff1f5d7e3"/><file name="Order.php" hash="fdcbad1124492f520b9edb72e0d88463"/><file name="Product.php" hash="e988fbf3dcf5ef6ea898b2668f2c4f55"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="Test"><dir name="Config"><file name="Base.php" hash="997583679f0981fbd2f0560cf40855d1"/></dir><dir name="Model"><dir name="Observer"><file name="Order.php" hash="d4655e7789a87b3fe8093355e862bfc4"/><file name="Product.php" hash="b9d3920d0d489c39245f747f15187085"/></dir></dir></dir><dir name="controllers"><file name="WizardController.php" hash="558e829a66e2ad9a7b7c1ad9d7d4a530"/></dir><dir name="etc"><file name="config.xml" hash="215ec9ebcca47551da78e741cd6ca029"/><file name="system.xml" hash="f494e9ed2da1f2554196847753629cb4"/></dir><file name=".DS_Store" hash="d8b910e9c4677fce43c430c2bb123061"/></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="ometria"><file name="core.xml" hash="d8d696fec5b40262b9307a0bb89bcede"/></dir></dir><dir name="template"><dir name="ometria"><file name="head.phtml" hash="1ef17e826431c85e14532d7660b38ee8"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="ometria"><file name="core.xml" hash="4fd702d8159187002eebb40c9b3ebe1b"/></dir></dir><dir name="template"><dir name="ometria"><dir name="system"><dir name="config"><file name="start_wizard.phtml" hash="d4a4e6d6ab16048f1e436793cb24a668"/></dir></dir><dir name="wizard"><file name="finished.phtml" hash="e475e0a7fb28b2b054a1b26cae5fd9b8"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ometria_Core.xml" hash="f8ec0ef46b669bf0070d9064300fc0fd"/><file name="Ometria_Api.xml" hash="e9309a378992b51f710a9fca17a3055e"/><file name="Ometria_AbandonedCarts.xml" hash="a69a03804840e784362410c2596c0a08"/></dir></target><target name="mageweb"><dir name="js"><dir name="ometria"><file name="checkout.js" hash="78b5fed53276d65a42c5cad4bf92a35f"/></dir></dir></target></contents>
31
  <compatible/>
32
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
33
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Ometria_Magento_Extension</name>
4
+ <version>1.1.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Source License (OSL)</license>
7
  <channel>community</channel>
21
  We don't just pull the right data together in one place, we also create insights. Our team of data scientists have created a set of algorithms to spot weaknesses, under-performance and opportunities, so every time a retailer logs into their dashboards we present a short list of top revenue wins.&#xD;
22
  &#xD;
23
  Whether it's with our multi-dimension funnel analysis which flags up specific channels that may be under-performing, or our customer dashboard which spots channels that deliver customers with the best CLV, our 'actionable insights' come ready to go.</description>
24
+ <notes>Better multi store ping support and better newsletter support.</notes>
 
 
25
  <authors><author><name>Alastair James</name><user>aljames1981</user><email>al.james@gmail.com</email></author></authors>
26
+ <date>2015-09-02</date>
27
+ <time>11:38:09</time>
28
+ <contents><target name="magecommunity"><dir name="Ometria"><dir name="AbandonedCarts"><dir name="Helper"><file name="Config.php" hash="4ea2f9de193a510a1438a1911f6e9a8d"/><file name="Data.php" hash="1348c35f00b49b2b30034f0d9a819ae8"/></dir><dir name="controllers"><file name="CartlinkController.php" hash="0116b91a5a5ce16319a7665bb4261fe6"/></dir><dir name="etc"><file name="config.xml" hash="edd31cb43f45f28f4c07b2668a89f712"/><file name="system.xml" hash="11db59f5c2f864525e4c1cdd06283ac1"/></dir></dir><dir name="Api"><dir name="Helper"><file name="Data.php" hash="8a19a3bf39de93fab7d2e1333c3c0806"/></dir><dir name="Model"><file name="Api.php" hash="4dba56cef3f7d73084e3475cbf37fdbe"/><file name="Api2.php" hash="e34e5530d8e828fcdb2ce09f6abef01d"/><file name="FixedCouponGenerator.php" hash="b37f5df7471dca9437a7aed70b4c53c0"/></dir><dir name="etc"><file name="api.xml" hash="51d02f0154ac396ef90f4ff484253af3"/><file name="config.xml" hash="96a531ee2b241e024058fa38b7310a02"/></dir></dir><dir name="Core"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Startwizard.php" hash="48c0cc3736f8a7fbd871d92d1aed9a81"/></dir></dir><dir name="Wizard"><file name="Finished.php" hash="3325319ce22b23c3661a15b7ab6cbb83"/><dir name="Start"><file name="Form.php" hash="e5d6f86a9718da044104245b46230674"/></dir><file name="Start.php" hash="befc4575e361b7a9916f929e2fc58c45"/></dir></dir><file name="Head.php" hash="1b00336f0bd24d46c56b6ced4c0515a6"/></dir><dir name="Helper"><file name="Config.php" hash="2d9a42f28c768aac826a590aaf571488"/><file name="Cookiechannel.php" hash="c3751e4e855b6612e2c4c99feeab4c5e"/><file name="Data.php" hash="26c20107047db9e3911118efbf083135"/><file name="Ping.php" hash="3bec467a79d2f28722f941ff92e397ef"/><file name="Product.php" hash="60e3b6bcb43884af7e4a4ed48c3e3411"/><file name="Session.php" hash="798245d7d20c523b3c386c8bf25979d2"/></dir><dir name="Model"><dir name="Config"><dir name="Source"><file name="Productmode.php" hash="3b37b999e8d49fc23af6229bcae86bb9"/></dir></dir><dir name="Observer"><file name="Cart.php" hash="4ff09116e9a98bab70dc2f45bd4ce321"/><file name="Customer.php" hash="a42a16275f41601e39b9cdeb5c3aba01"/><file name="Newsletter.php" hash="263acdd139355f562fec961cbbbda633"/><file name="Order.php" hash="ae8ab4434a2ee14d0ed95495df65d17f"/><file name="Product.php" hash="e988fbf3dcf5ef6ea898b2668f2c4f55"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="Test"><dir name="Config"><file name="Base.php" hash="997583679f0981fbd2f0560cf40855d1"/></dir><dir name="Model"><dir name="Observer"><file name="Order.php" hash="d4655e7789a87b3fe8093355e862bfc4"/><file name="Product.php" hash="b9d3920d0d489c39245f747f15187085"/></dir></dir></dir><dir name="controllers"><file name="WizardController.php" hash="558e829a66e2ad9a7b7c1ad9d7d4a530"/></dir><dir name="etc"><file name="config.xml" hash="c7ba11e2208af91b35e6e1a15897dad8"/><file name="system.xml" hash="f494e9ed2da1f2554196847753629cb4"/></dir><file name=".DS_Store" hash="d8b910e9c4677fce43c430c2bb123061"/></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="ometria"><file name="core.xml" hash="d8d696fec5b40262b9307a0bb89bcede"/></dir></dir><dir name="template"><dir name="ometria"><file name="head.phtml" hash="1ef17e826431c85e14532d7660b38ee8"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="ometria"><file name="core.xml" hash="4fd702d8159187002eebb40c9b3ebe1b"/></dir></dir><dir name="template"><dir name="ometria"><dir name="system"><dir name="config"><file name="start_wizard.phtml" hash="d4a4e6d6ab16048f1e436793cb24a668"/></dir></dir><dir name="wizard"><file name="finished.phtml" hash="e475e0a7fb28b2b054a1b26cae5fd9b8"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ometria_Core.xml" hash="f8ec0ef46b669bf0070d9064300fc0fd"/><file name="Ometria_Api.xml" hash="e9309a378992b51f710a9fca17a3055e"/><file name="Ometria_AbandonedCarts.xml" hash="a69a03804840e784362410c2596c0a08"/></dir></target><target name="mageweb"><dir name="js"><dir name="ometria"><file name="checkout.js" hash="78b5fed53276d65a42c5cad4bf92a35f"/></dir></dir></target></contents>
29
  <compatible/>
30
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
31
  </package>