Brainsins_Recommender - Version 2.1.7.2

Version Notes

[Fix] Fixed issue when printing brainsins_qhash into brainsinsdata in cart page. [New] Now we track extra info from cart within user login.

Download this release

Release Info

Developer BrainSINS
Extension Brainsins_Recommender
Version 2.1.7.2
Comparing to
See all releases


Code changes from version 2.1.7.1 to 2.1.7.2

app/code/community/Brainsins/Recommender/Model/Observer.php CHANGED
@@ -99,18 +99,19 @@ class Brainsins_Recommender_Model_Observer extends Mage_Core_Model_Abstract
99
  //check and update brainsins_qhash
100
  $quote=$observer->getEvent()->getQuote();
101
  if($quote!==null){
 
102
  $brainsins_qhash=$quote->getData('brainsins_qhash');
103
  if($brainsins_qhash ===null || $brainsins_qhash===""){
104
  $brainsins_qhash=md5($quote->getId());
105
- $session = Mage::getSingleton('checkout/session');
106
- $session->setData("brainsins_qhash",$brainsins_qhash);
107
  try{
108
  $quote->setData('brainsins_qhash',$brainsins_qhash);
109
  $quote->save();
110
  }catch(Exception $e){
111
  error_log("[BrainSINS]".$e);
112
  }
113
- }
 
 
114
  }
115
 
116
  Mage::helper('brainsins_recommender')->updateCartInBrainsins(Mage::getSingleton('checkout/session')->getQuote(), true);
99
  //check and update brainsins_qhash
100
  $quote=$observer->getEvent()->getQuote();
101
  if($quote!==null){
102
+ $session = Mage::getSingleton('checkout/session');
103
  $brainsins_qhash=$quote->getData('brainsins_qhash');
104
  if($brainsins_qhash ===null || $brainsins_qhash===""){
105
  $brainsins_qhash=md5($quote->getId());
 
 
106
  try{
107
  $quote->setData('brainsins_qhash',$brainsins_qhash);
108
  $quote->save();
109
  }catch(Exception $e){
110
  error_log("[BrainSINS]".$e);
111
  }
112
+
113
+ }
114
+ $session->setData("brainsins_qhash",$brainsins_qhash);
115
  }
116
 
117
  Mage::helper('brainsins_recommender')->updateCartInBrainsins(Mage::getSingleton('checkout/session')->getQuote(), true);
app/code/community/Brainsins/Recommender/etc/config.xml CHANGED
@@ -15,7 +15,7 @@
15
  <config>
16
  <modules>
17
  <Brainsins_Recommender>
18
- <version>2.1.6</version>
19
  </Brainsins_Recommender>
20
  </modules>
21
  <global>
15
  <config>
16
  <modules>
17
  <Brainsins_Recommender>
18
+ <version>2.1.7.2</version>
19
  </Brainsins_Recommender>
20
  </modules>
21
  <global>
app/design/frontend/base/default/template/brainsins/recommender/js.phtml CHANGED
@@ -105,6 +105,7 @@
105
 
106
  function bsBuildBdata($doLogin)
107
  {
 
108
  $bdata = Array();
109
  $bdata["language"] = Mage::app()->getStore()->getCode();
110
  $bdata["currency"] = Mage::app()->getStore()->getCurrentCurrencyCode();
@@ -132,11 +133,10 @@
132
  $bdata["pageType"] = "cart";
133
  $bdata["cart"] = bsCartInfo(false);
134
  //track misc data for order
135
- $session = Mage::getSingleton('checkout/session');
136
- if($session->getData("brainsins_qhash")){
137
  $bdata["cart"]["misc"] =array(
138
- "quoteId"=>$session->getQuoteId(),
139
- "brainsins_qhash"=>$session->getData("brainsins_qhash")
140
  );
141
  }
142
  }
@@ -183,6 +183,13 @@
183
  $bdata["user"]["lastName"]=$userData["lastname"];
184
  $bdata["user"]["middleName"]=$userData["middlename"];
185
  $bdata["user"]["group_id"]=$userData["group_id"];
 
 
 
 
 
 
 
186
  //avoid sending the info multiple times, send it only once in session
187
  Mage::getSingleton('customer/session')->setData('brainsins_userTrack_sent',1);
188
  }
105
 
106
  function bsBuildBdata($doLogin)
107
  {
108
+ $checkoutSession = Mage::getSingleton('checkout/session');
109
  $bdata = Array();
110
  $bdata["language"] = Mage::app()->getStore()->getCode();
111
  $bdata["currency"] = Mage::app()->getStore()->getCurrentCurrencyCode();
133
  $bdata["pageType"] = "cart";
134
  $bdata["cart"] = bsCartInfo(false);
135
  //track misc data for order
136
+ if($checkoutSession->getData("brainsins_qhash")){
 
137
  $bdata["cart"]["misc"] =array(
138
+ "quoteId"=>$checkoutSession->getQuoteId(),
139
+ "brainsins_qhash"=>$checkoutSession->getData("brainsins_qhash")
140
  );
141
  }
142
  }
183
  $bdata["user"]["lastName"]=$userData["lastname"];
184
  $bdata["user"]["middleName"]=$userData["middlename"];
185
  $bdata["user"]["group_id"]=$userData["group_id"];
186
+ //track misc data for user logged
187
+ if($checkoutSession->getData("brainsins_qhash")){
188
+ $bdata["user"]["bs_cart"]["misc"] =array(
189
+ "quoteId"=>$checkoutSession->getQuoteId(),
190
+ "brainsins_qhash"=>$checkoutSession->getData("brainsins_qhash")
191
+ );
192
+ }
193
  //avoid sending the info multiple times, send it only once in session
194
  Mage::getSingleton('customer/session')->setData('brainsins_userTrack_sent',1);
195
  }
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Brainsins_Recommender</name>
4
- <version>2.1.7.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/gpl-license.php">GPL</license>
7
  <channel>community</channel>
@@ -18,11 +18,11 @@ Some key features:&#xD;
18
  * Easily create marketing rules that modify your e-commerce website or interact with your customers according to user behavior.&#xD;
19
  * Use gamification to engage and cultivate the loyalty of your customers and grow a community of prescribers.&#xD;
20
  * We provide a full e-commerce analytics solution to help you understand the evolution of your online business.</description>
21
- <notes>New user tracking is triggered only once per session.</notes>
22
  <authors><author><name>BrainSINS</name><user>Developer</user><email>support@brainsins.com</email></author></authors>
23
- <date>2016-10-03</date>
24
- <time>10:05:11</time>
25
- <contents><target name="magecommunity"><dir name="Brainsins"><dir name="Recommender"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Expanded.php" hash="8fb32bbec5454610a8aab055c8891bf7"/><file name="Help.php" hash="df89b5f0a9d7510aa1393c888324e6dd"/></dir><dir name="Form"><dir name="Fieldset"><dir name="Dashboard"><file name="Dashboard.php" hash="7fcdcc0b077e1fcd40f209ada40d183e"/></dir></dir></dir><dir name="Source"><dir name="Feeds"><file name="ProductOffline.php" hash="d2480bf9d3a79f41b5889c46f747c008"/><file name="ProductOnline.php" hash="8a64b9b4cf0b1e57e0afa19889271934"/></dir><dir name="Recommenders"><file name="Cart.php" hash="3c8b3efaa4edfb696483b7e04787f852"/><file name="Category.php" hash="df3bdf28ef21e61d954d561e5bf69e13"/><file name="Checkout.php" hash="a4cf4b2b0df44b8efdc983a2616105c1"/><file name="Home.php" hash="c77c1afbdac04b9eec90e749aa67a6f9"/><file name="Product.php" hash="2ca0f98935197a5f515d0882e4177e00"/><file name="Show.php" hash="108263f746e4650ad46878b97edfd43c"/></dir></dir></dir></dir></dir><file name="Recommendations.php" hash="223234fb802b171bc46d4840e9a3e325"/></dir><dir name="Helper"><file name="Data.php" hash="a32634f64cf30fc068391e8208706f3c"/><file name="sendBrainsinsWS.log" hash="3ea4f9e70438ab097c878da3f1929a0f"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backend"><file name="Cron.php" hash="f0187336296261795b3163d7da20a24d"/><file name="Serialized.php" hash="c68122c82e7e1fc13a2575ac4e417d78"/></dir><dir name="Source"><file name="Apimode.php" hash="80852b4069d03c7a3b70390d67d2f875"/><file name="Attributes.php" hash="c223fe5451b35bb8779ec8d3e077d4b7"/><file name="Configurableproducttracking.php" hash="3b3c28b4142d90abafeacb3daa13f035"/><file name="Currencies.php" hash="478e4c7a7ca1d3d8d984c37af1d487e6"/><file name="Emailtracking.php" hash="017ec03450cff0317cb390830eca26ef"/><file name="Totalamounttrackingoptions.php" hash="0bba8d100a8a78030dd6a12ffe443c40"/></dir></dir></dir></dir><file name="Brainsins.php" hash="4012634c558c030effa04c92485621ba"/><file name="Cron.php" hash="04e1ed2c59fa488e614fe903abac45d1"/><file name="Observer.php" hash="8827c65cf4d6a3443bd1b80834043304"/><file name="Recommendation.php" hash="a8918aceeb106b2b5afe8664c87229ef"/><file name=".DS_Store" hash="5e07621f6f2348ae9d991910f46b3b71"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="FeedsController.php" hash="d318a3d4ba80b9587229a4f364bd3de3"/></dir><file name="CartController.php" hash="d4eac15059730ad6cd8b454e0e22e16d"/><file name="FeedController.php" hash="f537330700e1cc70e4260357af6a2db0"/><file name="LoginController.php" hash="3e2e8ff8564e987ba1550f54246737ed"/><file name="PurchaseController.php" hash="584b0ba37024bb84cf0171fc23fb2a9d"/><file name="RecommendationController.php" hash="1ead8f07f6ff07b5ed2283581a4ad1ab"/><file name="TrackingController.php" hash="04b22c332cdd9ad47dfab42c39bab66b"/></dir><dir name="etc"><file name="config.xml" hash="9576eb8ef1d0eec5b1ad98210af6aaa9"/><file name="system.xml" hash="7c5e34a435ca19760334398a8f7b5b1b"/></dir><dir name="sql"><dir name="recommender_setup"><file name="mysql4-install-2.1.6.php" hash="b412f2e3b2bea04a8fdaca01f8586163"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="brainsins_recommender.xml" hash="a0008aeb7f895e96b60995792d37bed9"/></dir><dir name="template"><dir name="brainsins"><dir name="recommender"><file name="help.phtml" hash="890622a39d07bd9029fbab39e3f7abf7"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="brainsins_recommender.xml" hash="6a98a70604110c1fb7596ce0cdc93fb9"/></dir><dir name="template"><dir name="brainsins"><dir name="recommender"><file name="header.phtml" hash="0b96e5604460941461c13557a5cb8ff8"/><file name="js.phtml" hash="4b57f67182c3f5263adbce855c7486b9"/><file name="sample.phtml" hash="cc1459aedacb18b5360182f8a1f7177d"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Brainsins_Recommender.xml" hash="b66f774ab8de3a90258047d6701491aa"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Brainsins_Recommender.csv" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir><dir name="es_ES"><file name="Brainsins_Recommender.csv" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="brainsins"><dir name="recommender"><dir name="css"><file name="brainsins_recommender.css" hash="db420d334316b3d19f013c7d1289e6c8"/></dir><dir name="images"><file name="brainsins.png" hash="98f06e0c5eb7668dd7293fc89614f7bc"/><file name="brainsins_logo.png" hash="cb4086cde3e5eef572159bd9f2ebd298"/><file name="feed_file_nok.gif" hash="e4f28607f075a105e53fa3113d84bd26"/><file name="feed_file_ok.gif" hash="834dfafd5f8b44c4b24a4c00add56fcf"/></dir><dir name="js"><file name="brainsins_recommender.js" hash="6ceed921b60e8590a70ee9db54e04811"/></dir></dir></dir></dir></dir></dir></target></contents>
26
  <compatible/>
27
  <dependencies><required><php><min>5.2.0</min><max>7.0.0</max></php></required></dependencies>
28
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Brainsins_Recommender</name>
4
+ <version>2.1.7.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/gpl-license.php">GPL</license>
7
  <channel>community</channel>
18
  * Easily create marketing rules that modify your e-commerce website or interact with your customers according to user behavior.&#xD;
19
  * Use gamification to engage and cultivate the loyalty of your customers and grow a community of prescribers.&#xD;
20
  * We provide a full e-commerce analytics solution to help you understand the evolution of your online business.</description>
21
+ <notes>[Fix] Fixed issue when printing brainsins_qhash into brainsinsdata in cart page. [New] Now we track extra info from cart within user login.</notes>
22
  <authors><author><name>BrainSINS</name><user>Developer</user><email>support@brainsins.com</email></author></authors>
23
+ <date>2016-10-24</date>
24
+ <time>10:05:02</time>
25
+ <contents><target name="magecommunity"><dir name="Brainsins"><dir name="Recommender"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Expanded.php" hash="8fb32bbec5454610a8aab055c8891bf7"/><file name="Help.php" hash="df89b5f0a9d7510aa1393c888324e6dd"/></dir><dir name="Form"><dir name="Fieldset"><dir name="Dashboard"><file name="Dashboard.php" hash="7fcdcc0b077e1fcd40f209ada40d183e"/></dir></dir></dir><dir name="Source"><dir name="Feeds"><file name="ProductOffline.php" hash="d2480bf9d3a79f41b5889c46f747c008"/><file name="ProductOnline.php" hash="8a64b9b4cf0b1e57e0afa19889271934"/></dir><dir name="Recommenders"><file name="Cart.php" hash="3c8b3efaa4edfb696483b7e04787f852"/><file name="Category.php" hash="df3bdf28ef21e61d954d561e5bf69e13"/><file name="Checkout.php" hash="a4cf4b2b0df44b8efdc983a2616105c1"/><file name="Home.php" hash="c77c1afbdac04b9eec90e749aa67a6f9"/><file name="Product.php" hash="2ca0f98935197a5f515d0882e4177e00"/><file name="Show.php" hash="108263f746e4650ad46878b97edfd43c"/></dir></dir></dir></dir></dir><file name="Recommendations.php" hash="223234fb802b171bc46d4840e9a3e325"/></dir><dir name="Helper"><file name="Data.php" hash="a32634f64cf30fc068391e8208706f3c"/><file name="sendBrainsinsWS.log" hash="3ea4f9e70438ab097c878da3f1929a0f"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backend"><file name="Cron.php" hash="f0187336296261795b3163d7da20a24d"/><file name="Serialized.php" hash="c68122c82e7e1fc13a2575ac4e417d78"/></dir><dir name="Source"><file name="Apimode.php" hash="80852b4069d03c7a3b70390d67d2f875"/><file name="Attributes.php" hash="c223fe5451b35bb8779ec8d3e077d4b7"/><file name="Configurableproducttracking.php" hash="3b3c28b4142d90abafeacb3daa13f035"/><file name="Currencies.php" hash="478e4c7a7ca1d3d8d984c37af1d487e6"/><file name="Emailtracking.php" hash="017ec03450cff0317cb390830eca26ef"/><file name="Totalamounttrackingoptions.php" hash="0bba8d100a8a78030dd6a12ffe443c40"/></dir></dir></dir></dir><file name="Brainsins.php" hash="4012634c558c030effa04c92485621ba"/><file name="Cron.php" hash="04e1ed2c59fa488e614fe903abac45d1"/><file name="Observer.php" hash="10c6945e75acb09935cf3bb216965a6a"/><file name="Recommendation.php" hash="a8918aceeb106b2b5afe8664c87229ef"/><file name=".DS_Store" hash="5e07621f6f2348ae9d991910f46b3b71"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="FeedsController.php" hash="d318a3d4ba80b9587229a4f364bd3de3"/></dir><file name="CartController.php" hash="d4eac15059730ad6cd8b454e0e22e16d"/><file name="FeedController.php" hash="f537330700e1cc70e4260357af6a2db0"/><file name="LoginController.php" hash="3e2e8ff8564e987ba1550f54246737ed"/><file name="PurchaseController.php" hash="584b0ba37024bb84cf0171fc23fb2a9d"/><file name="RecommendationController.php" hash="1ead8f07f6ff07b5ed2283581a4ad1ab"/><file name="TrackingController.php" hash="04b22c332cdd9ad47dfab42c39bab66b"/></dir><dir name="etc"><file name="config.xml" hash="180545621975b19b49c72bc240dd8f00"/><file name="system.xml" hash="7c5e34a435ca19760334398a8f7b5b1b"/></dir><dir name="sql"><dir name="recommender_setup"><file name="mysql4-install-2.1.6.php" hash="b412f2e3b2bea04a8fdaca01f8586163"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="brainsins_recommender.xml" hash="a0008aeb7f895e96b60995792d37bed9"/></dir><dir name="template"><dir name="brainsins"><dir name="recommender"><file name="help.phtml" hash="890622a39d07bd9029fbab39e3f7abf7"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="brainsins_recommender.xml" hash="6a98a70604110c1fb7596ce0cdc93fb9"/></dir><dir name="template"><dir name="brainsins"><dir name="recommender"><file name="header.phtml" hash="0b96e5604460941461c13557a5cb8ff8"/><file name="js.phtml" hash="7159c85e9afaba6373e72d13683b1709"/><file name="sample.phtml" hash="cc1459aedacb18b5360182f8a1f7177d"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Brainsins_Recommender.xml" hash="b66f774ab8de3a90258047d6701491aa"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Brainsins_Recommender.csv" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir><dir name="es_ES"><file name="Brainsins_Recommender.csv" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="brainsins"><dir name="recommender"><dir name="css"><file name="brainsins_recommender.css" hash="db420d334316b3d19f013c7d1289e6c8"/></dir><dir name="images"><file name="brainsins.png" hash="98f06e0c5eb7668dd7293fc89614f7bc"/><file name="brainsins_logo.png" hash="cb4086cde3e5eef572159bd9f2ebd298"/><file name="feed_file_nok.gif" hash="e4f28607f075a105e53fa3113d84bd26"/><file name="feed_file_ok.gif" hash="834dfafd5f8b44c4b24a4c00add56fcf"/></dir><dir name="js"><file name="brainsins_recommender.js" hash="6ceed921b60e8590a70ee9db54e04811"/></dir></dir></dir></dir></dir></dir></target></contents>
26
  <compatible/>
27
  <dependencies><required><php><min>5.2.0</min><max>7.0.0</max></php></required></dependencies>
28
  </package>