flowecommerce_resultadosdigitais - Version 0.1.6.2

Version Notes

- Tracking RD

Download this release

Release Info

Developer Flow eCommerce
Extension flowecommerce_resultadosdigitais
Version 0.1.6.2
Comparing to
See all releases


Code changes from version 0.1.6.1 to 0.1.6.2

app/code/local/Flowecommerce/Resultadosdigitais/Block/Apijs.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Flowecommerce_Resultadosdigitais_Block_Apijs extends Mage_Core_Block_Template {
4
+
5
+ public function getCustomerEmail() {
6
+ return $this->helper('customer')->getCustomer()->getEmail();
7
+ }
8
+
9
+ public function getJsApiUrl() {
10
+ return $this->helper('resultadosdigitais')->getJsApiUrl();
11
+ }
12
+
13
+ public function getTokenPublico() {
14
+ return $this->helper('resultadosdigitais')->getToken();
15
+ }
16
+
17
+ public function isTrack() {
18
+ $isLoggedIn = $this->helper('customer')->isLoggedIn();
19
+ $enabled = $this->helper('resultadosdigitais')->isEnabled();
20
+ return $enabled && $isLoggedIn;
21
+ }
22
+
23
+
24
+
25
+ }
app/code/local/Flowecommerce/Resultadosdigitais/Block/Categoryview.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Flowecommerce_Resultadosdigitais_Block_Categoryview extends Flowecommerce_Resultadosdigitais_Block_Apijs {
4
+
5
+ public function getIdentificador() {
6
+ return Flowecommerce_Resultadosdigitais_Model_Observer::LEAD_CATEGORYVIEW;
7
+ }
8
+
9
+ public function getNomeCategoria() {
10
+ return Mage::registry('current_category')->getName();
11
+ }
12
+ }
app/code/local/Flowecommerce/Resultadosdigitais/Block/Productview.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Flowecommerce_Resultadosdigitais_Block_Productview extends Flowecommerce_Resultadosdigitais_Block_Apijs {
4
+
5
+ public function getIdentificador() {
6
+ return Flowecommerce_Resultadosdigitais_Model_Observer::LEAD_PRODUCTVIEW;
7
+ }
8
+
9
+ public function getNomeProduto() {
10
+ return Mage::registry('current_product')->getName();
11
+ }
12
+
13
+ public function getSkuProduto() {
14
+ return Mage::registry('current_product')->getSku();
15
+ }
16
+ }
app/code/local/Flowecommerce/Resultadosdigitais/Helper/Data.php CHANGED
@@ -14,4 +14,8 @@ class Flowecommerce_Resultadosdigitais_Helper_Data extends Mage_Core_Helper_Abst
14
  return Mage::getStoreConfigFlag('resultadosdigitais/general/enable');
15
  }
16
 
 
 
 
 
17
  }
14
  return Mage::getStoreConfigFlag('resultadosdigitais/general/enable');
15
  }
16
 
17
+ public function getJsApiUrl() {
18
+ return Mage::getStoreConfig('resultadosdigitais/general/jsapurl');
19
+ }
20
+
21
  }
app/code/local/Flowecommerce/Resultadosdigitais/Model/Api.php CHANGED
@@ -94,6 +94,10 @@ class Flowecommerce_Resultadosdigitais_Model_Api
94
  $return['traffic_source'] = $_COOKIE['__trf_src'];
95
  }
96
 
 
 
 
 
97
  return $return;
98
  }
99
 
@@ -108,4 +112,4 @@ class Flowecommerce_Resultadosdigitais_Model_Api
108
 
109
  return $return;
110
  }
111
- }
94
  $return['traffic_source'] = $_COOKIE['__trf_src'];
95
  }
96
 
97
+ if (!empty($_COOKIE['rdtrk'])) {
98
+ $return['client_id'] = json_decode($_COOKIE['rdtrk'])->{'id'};
99
+ }
100
+
101
  return $return;
102
  }
103
 
112
 
113
  return $return;
114
  }
115
+ }
app/code/local/Flowecommerce/Resultadosdigitais/Model/Observer.php CHANGED
@@ -18,6 +18,8 @@ class Flowecommerce_Resultadosdigitais_Model_Observer {
18
  const LEAD_RECURRINGPAYMENTPLANCANCELED = 'recurring-payment-plan-canceled';
19
  const LEAD_RECURRINGPAYMENTPLANREACTIVATED = 'recurring-payment-plan-reactivated';
20
  const LEAD_PRODUCTADDEDTOCART = 'product-added-to-cart';
 
 
21
 
22
  /**
23
  * Cliente tipo pessoa juridica - Compatibilidade com módulo PJ Flow
@@ -65,10 +67,22 @@ class Flowecommerce_Resultadosdigitais_Model_Observer {
65
  $post = $data['controller_action']->getRequest()->getPost();
66
 
67
  $data = $this->_getRequestDataObject();
68
- $data->setEmail($post['email']);
69
- $data->setNome($post['name']);
70
- $data->setTelefone($post['telephone']);
71
- $data->setMensagem($post['comment']);
 
 
 
 
 
 
 
 
 
 
 
 
72
 
73
  $data->setData('store_name', $this->_getStoreDataObject()->getName());
74
 
18
  const LEAD_RECURRINGPAYMENTPLANCANCELED = 'recurring-payment-plan-canceled';
19
  const LEAD_RECURRINGPAYMENTPLANREACTIVATED = 'recurring-payment-plan-reactivated';
20
  const LEAD_PRODUCTADDEDTOCART = 'product-added-to-cart';
21
+ const LEAD_PRODUCTVIEW = 'product-view';
22
+ const LEAD_CATEGORYVIEW = 'category-view';
23
 
24
  /**
25
  * Cliente tipo pessoa juridica - Compatibilidade com módulo PJ Flow
67
  $post = $data['controller_action']->getRequest()->getPost();
68
 
69
  $data = $this->_getRequestDataObject();
70
+
71
+ if (array_key_exists('email', $post)) {
72
+ $data->setEmail($post['email']);
73
+ }
74
+
75
+ if (array_key_exists('name', $post)) {
76
+ $data->setNome($post['name']);
77
+ }
78
+
79
+ if (array_key_exists('telephone', $post)) {
80
+ $data->setTelefone($post['telephone']);
81
+ }
82
+
83
+ if (array_key_exists('comment', $post)) {
84
+ $data->setMensagem($post['comment']);
85
+ }
86
 
87
  $data->setData('store_name', $this->_getStoreDataObject()->getName());
88
 
app/code/local/Flowecommerce/Resultadosdigitais/etc/config.xml CHANGED
@@ -11,6 +11,11 @@
11
  <class>Flowecommerce_Resultadosdigitais_Model</class>
12
  </resultadosdigitais>
13
  </models>
 
 
 
 
 
14
  <helpers>
15
  <resultadosdigitais>
16
  <class>Flowecommerce_Resultadosdigitais_Helper</class>
@@ -113,8 +118,22 @@
113
  </flowecommerce_resultadosdigitais_add_to_cart>
114
  </observers>
115
  </checkout_cart_product_add_after>
116
-
117
-
118
  </events>
119
  </global>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  </config>
11
  <class>Flowecommerce_Resultadosdigitais_Model</class>
12
  </resultadosdigitais>
13
  </models>
14
+ <blocks>
15
+ <resultadosdigitais>
16
+ <class>Flowecommerce_Resultadosdigitais_Block</class>
17
+ </resultadosdigitais>
18
+ </blocks>
19
  <helpers>
20
  <resultadosdigitais>
21
  <class>Flowecommerce_Resultadosdigitais_Helper</class>
118
  </flowecommerce_resultadosdigitais_add_to_cart>
119
  </observers>
120
  </checkout_cart_product_add_after>
 
 
121
  </events>
122
  </global>
123
+ <frontend>
124
+ <layout>
125
+ <updates>
126
+ <resultadosdigitais>
127
+ <file>resultadosdigitais.xml</file>
128
+ </resultadosdigitais>
129
+ </updates>
130
+ </layout>
131
+ </frontend>
132
+ <default>
133
+ <resultadosdigitais>
134
+ <general>
135
+ <jsapurl>https://d335luupugsy2.cloudfront.net/js/integration/stable/rd-js-integration.min.js</jsapurl>
136
+ </general>
137
+ </resultadosdigitais>
138
+ </default>
139
  </config>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>flowecommerce_resultadosdigitais</name>
4
- <version>0.1.6.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -16,12 +16,11 @@ Uma nova conta de cliente &#xE9; criada&#xD;
16
  Um novo pedido &#xE9; criado&#xD;
17
  Um cliente assina a newsletter da loja virtual&#xD;
18
  Um produto &#xE9; adicionado ao carrinho quando o cliente est&#xE1; logado</description>
19
- <notes>- Traffic source sendo enviado ao RD atrav&#xE9;s da integra&#xE7;&#xE3;o quando dispon&#xED;vel&#xD;
20
- - Mensagem do formul&#xE1;rio de contato sendo enviada ao RD</notes>
21
  <authors><author><name>Flow eCommerce</name><user>flowecommerce</user><email>contato@flowecommerce.com</email></author><author><name>Gabriel Queiroz Silva</name><user>gabrielqs</user><email>gabriel@flowecommerce.com</email></author></authors>
22
- <date>2015-12-18</date>
23
- <time>20:54:55</time>
24
- <contents><target name="magelocal"><dir name="Flowecommerce"><dir name="Resultadosdigitais"><dir name="Helper"><file name="Data.php" hash="00d2ae49825e162eb99dd72a98895a61"/></dir><dir name="Model"><file name="Api.php" hash="946d25e1281ef7acc3148cefebdd7114"/><dir name="Googleanalytics"><file name="Customvar.php" hash="d163ebb5bb590dd7553ed1356c033a2c"/><file name="Tracker.php" hash="be95e10bd1df9ca5319f5a50967f2eed"/><dir name="Utm"><file name="A.php" hash="7604206d87189c56f109231c4a95f00f"/><file name="B.php" hash="e710a66f3c061f4da69e9f468c2eaf5c"/><file name="C.php" hash="27c99ca82b05b11bcba01e88f9a3e5c6"/><file name="V.php" hash="9c77ced8175034ac42b89878e26844f5"/><file name="Z.php" hash="1bb0821f8752993b737a923fcbd4b314"/></dir></dir><file name="Observer.php" hash="c62b049ff7d369ae8bef20ace48dc189"/><file name="Requestdata.php" hash="d97634793fae544f18e5ffda617ed745"/></dir><dir name="etc"><file name="adminhtml.xml" hash="be9b06eed9df502e9759b5cd397f9fa2"/><file name="config.xml" hash="63210a633bd6b528d03482e23e493cf2"/><file name="system.xml" hash="da64ea97bc98fe6f42988df79c2ace1f"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Flowecommerce_Resultadosdigitais.xml" hash="5d476dea8a51bda77126fa637c5f29f2"/></dir></target></contents>
25
  <compatible/>
26
  <dependencies><required><php><min>5.3.0</min><max>5.6.16</max></php></required></dependencies>
27
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>flowecommerce_resultadosdigitais</name>
4
+ <version>0.1.6.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
16
  Um novo pedido &#xE9; criado&#xD;
17
  Um cliente assina a newsletter da loja virtual&#xD;
18
  Um produto &#xE9; adicionado ao carrinho quando o cliente est&#xE1; logado</description>
19
+ <notes>- Tracking RD</notes>
 
20
  <authors><author><name>Flow eCommerce</name><user>flowecommerce</user><email>contato@flowecommerce.com</email></author><author><name>Gabriel Queiroz Silva</name><user>gabrielqs</user><email>gabriel@flowecommerce.com</email></author></authors>
21
+ <date>2016-03-10</date>
22
+ <time>00:09:46</time>
23
+ <contents><target name="magelocal"><dir name="Flowecommerce"><dir name="Resultadosdigitais"><dir name="Block"><file name="Apijs.php" hash="c2e7219f6982976799e52f57a8ad7bbf"/><file name="Categoryview.php" hash="1451eca90c6db1c6404da530591db4cc"/><file name="Productview.php" hash="8907353a400c6ca016f93ab0c5ea4599"/></dir><dir name="Helper"><file name="Data.php" hash="09882c5456e06cecd6c185281596af56"/></dir><dir name="Model"><file name="Api.php" hash="2ac8c401791376adaa0eaf005bf74b5d"/><dir name="Googleanalytics"><file name="Customvar.php" hash="d163ebb5bb590dd7553ed1356c033a2c"/><file name="Tracker.php" hash="be95e10bd1df9ca5319f5a50967f2eed"/><dir name="Utm"><file name="A.php" hash="7604206d87189c56f109231c4a95f00f"/><file name="B.php" hash="e710a66f3c061f4da69e9f468c2eaf5c"/><file name="C.php" hash="27c99ca82b05b11bcba01e88f9a3e5c6"/><file name="V.php" hash="9c77ced8175034ac42b89878e26844f5"/><file name="Z.php" hash="1bb0821f8752993b737a923fcbd4b314"/></dir></dir><file name="Observer.php" hash="ab9ee811fdd4055018f101788eec59b3"/><file name="Requestdata.php" hash="d97634793fae544f18e5ffda617ed745"/></dir><dir name="etc"><file name="adminhtml.xml" hash="be9b06eed9df502e9759b5cd397f9fa2"/><file name="config.xml" hash="f9dbcdc0795c8b19f4058991efca8891"/><file name="system.xml" hash="da64ea97bc98fe6f42988df79c2ace1f"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Flowecommerce_Resultadosdigitais.xml" hash="5d476dea8a51bda77126fa637c5f29f2"/></dir></target></contents>
24
  <compatible/>
25
  <dependencies><required><php><min>5.3.0</min><max>5.6.16</max></php></required></dependencies>
26
  </package>