recolize_recommendation_engine - Version 2.0.2

Version Notes

- Enabled the current category filter, which now can be used in the Recolize Tool
- The product feed profile names are now unique in a multistore setup with same store names
- The feed data is not aggregated anymore in a multistore setup
- Optimized the Recolize parameters JavaScript parts to avoid conflicts with other extensions in a merged JS setup

Download this release

Release Info

Developer Recolize GmbH
Extension recolize_recommendation_engine
Version 2.0.2
Comparing to
See all releases


Code changes from version 2.0.1 to 2.0.2

app/code/community/Recolize/RecommendationEngine/Model/Feed.php CHANGED
@@ -42,6 +42,11 @@ class Recolize_RecommendationEngine_Model_Feed extends Mage_Core_Model_Abstract
42
  foreach ($this->getFeedProfileCollection() as $profileModel) {
43
  /** @var Mage_DataFlow_Model_Profile $profileModel */
44
  try {
 
 
 
 
 
45
  $profileModel->run();
46
  } catch (Exception $exception) {
47
  Mage::logException($exception);
@@ -64,6 +69,18 @@ class Recolize_RecommendationEngine_Model_Feed extends Mage_Core_Model_Abstract
64
  return sprintf('product-export-%s.csv', md5($store->getId() . '#' . $store->getName() . '#' . $store->getCode()) . '-' . $store->getCode());
65
  }
66
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  /**
68
  * Return the Recolize DataFlow profiles.
69
  *
42
  foreach ($this->getFeedProfileCollection() as $profileModel) {
43
  /** @var Mage_DataFlow_Model_Profile $profileModel */
44
  try {
45
+ //The dataflow core module always uses getSingleton for the dataflow batch model instance.
46
+ //Therefore we have to remove the existing instance with every profile run, because otherwise
47
+ //the dataflow batch ids for the different profile runs keep the same, and the whole data of
48
+ //all profile runs get aggregated with every next profile run (within one cron run).
49
+ Mage::unregister('_singleton/dataflow/batch');
50
  $profileModel->run();
51
  } catch (Exception $exception) {
52
  Mage::logException($exception);
69
  return sprintf('product-export-%s.csv', md5($store->getId() . '#' . $store->getName() . '#' . $store->getCode()) . '-' . $store->getCode());
70
  }
71
 
72
+ /**
73
+ * Return a unique name for the DataFlow profile for the given store.
74
+ *
75
+ * @param Mage_Core_Model_Store $store
76
+ *
77
+ * @return string
78
+ */
79
+ public function getFeedProfileName(Mage_Core_Model_Store $store)
80
+ {
81
+ return self::DATAFLOW_PROFILE_NAME_PREFIX . ' ' . $store->getName() . '/' . $store->getCode();
82
+ }
83
+
84
  /**
85
  * Return the Recolize DataFlow profiles.
86
  *
app/code/community/Recolize/RecommendationEngine/data/recolize_re_setup/data-install-2.0.1.php CHANGED
@@ -21,13 +21,19 @@ foreach ($storeCollection as $store) {
21
  continue;
22
  }
23
 
24
- $feedFileName = Mage::getModel('recolize_recommendation_engine/feed')->getFeedFilename($store);
25
-
26
- $profileName = Recolize_RecommendationEngine_Model_Feed::DATAFLOW_PROFILE_NAME_PREFIX . ' ' . $store->getName();
27
 
28
  $profile = Mage::getModel('dataflow/profile')->load($profileName, 'name');
29
 
30
  if ($profile->isEmpty() === false) {
 
 
 
 
 
 
31
  $profile->run();
32
  }
33
  }
21
  continue;
22
  }
23
 
24
+ $feedModel = Mage::getModel('recolize_recommendation_engine/feed');
25
+ $feedFileName = $feedModel->getFeedFilename($store);
26
+ $profileName = $feedModel->getFeedProfileName($store);
27
 
28
  $profile = Mage::getModel('dataflow/profile')->load($profileName, 'name');
29
 
30
  if ($profile->isEmpty() === false) {
31
+ //The dataflow core module always uses getSingleton for the dataflow batch model instance.
32
+ //Therefore we have to remove the existing instance with every profile run, because otherwise
33
+ //the dataflow batch ids for the different profile runs keep the same, and the whole data of
34
+ //all profile runs get aggregated with every next profile run (within one cron run).
35
+ Mage::unregister('_singleton/dataflow/batch');
36
+
37
  $profile->run();
38
  }
39
  }
app/code/community/Recolize/RecommendationEngine/etc/config.xml CHANGED
@@ -16,7 +16,7 @@
16
  <config>
17
  <modules>
18
  <Recolize_RecommendationEngine>
19
- <version>2.0.1</version>
20
  </Recolize_RecommendationEngine>
21
  </modules>
22
  <global>
16
  <config>
17
  <modules>
18
  <Recolize_RecommendationEngine>
19
+ <version>2.0.2</version>
20
  </Recolize_RecommendationEngine>
21
  </modules>
22
  <global>
app/code/community/Recolize/RecommendationEngine/sql/recolize_re_setup/mysql4-install-2.0.0.php CHANGED
@@ -59,9 +59,9 @@ foreach ($storeCollection as $store) {
59
  continue;
60
  }
61
 
62
- $feedFileName = Mage::getModel('recolize_recommendation_engine/feed')->getFeedFilename($store);
63
-
64
- $profileName = Recolize_RecommendationEngine_Model_Feed::DATAFLOW_PROFILE_NAME_PREFIX . ' ' . $store->getName();
65
 
66
  $profile = Mage::getModel('dataflow/profile')->load($profileName, 'name')
67
  ->setName($profileName)
59
  continue;
60
  }
61
 
62
+ $feedModel = Mage::getModel('recolize_recommendation_engine/feed');
63
+ $feedFileName = $feedModel->getFeedFilename($store);
64
+ $profileName = $feedModel->getFeedProfileName($store);
65
 
66
  $profile = Mage::getModel('dataflow/profile')->load($profileName, 'name')
67
  ->setName($profileName)
app/design/frontend/base/default/template/recolize/recommendation_engine/add_to_cart.phtml CHANGED
@@ -18,7 +18,7 @@
18
  <script type="text/javascript">
19
  var RecolizeParameters = {};
20
  RecolizeParameters['itemAction'] = 'add_to_cart';
21
- RecolizeParameters['clickedItemId'] = <?php echo Mage::getModel('recolize_recommendation_engine/session')->getProductId(); ?>
22
  </script>
23
 
24
  <?php Mage::getSingleton('recolize_recommendation_engine/session')->clear(); ?>
18
  <script type="text/javascript">
19
  var RecolizeParameters = {};
20
  RecolizeParameters['itemAction'] = 'add_to_cart';
21
+ RecolizeParameters['clickedItemId'] = '<?php echo Mage::getModel('recolize_recommendation_engine/session')->getProductId(); ?>';
22
  </script>
23
 
24
  <?php Mage::getSingleton('recolize_recommendation_engine/session')->clear(); ?>
app/design/frontend/base/default/template/recolize/recommendation_engine/add_to_cart_ajax.phtml CHANGED
@@ -18,7 +18,7 @@
18
  <script type="text/javascript">
19
  var RecolizeParameters = {};
20
  RecolizeParameters['itemAction'] = 'add_to_cart';
21
- RecolizeParameters['clickedItemId'] = <?php echo Mage::getModel('recolize_recommendation_engine/session')->getProductId(); ?>
22
  Recolize.Recommendation.Api.request();
23
  </script>
24
 
18
  <script type="text/javascript">
19
  var RecolizeParameters = {};
20
  RecolizeParameters['itemAction'] = 'add_to_cart';
21
+ RecolizeParameters['clickedItemId'] = '<?php echo Mage::getModel('recolize_recommendation_engine/session')->getProductId(); ?>';
22
  Recolize.Recommendation.Api.request();
23
  </script>
24
 
app/design/frontend/base/default/template/recolize/recommendation_engine/category_view.phtml CHANGED
@@ -13,11 +13,11 @@
13
  */
14
  ?>
15
  <?php if (Mage::getStoreConfigFlag('recolize_recommendation_engine/general/enable_extension') === true): ?>
16
- <?php $currentCategoryId = Mage::registry('current_category')->getId(); ?>
17
 
18
  <script type="text/javascript">
19
  var RecolizeParameters = {};
20
  RecolizeParameters['specialPageType'] = 'category';
21
- RecolizeParameters['categoryId'] = '<?php echo $currentCategoryId ?>';
22
  </script>
23
  <?php endif; ?>
13
  */
14
  ?>
15
  <?php if (Mage::getStoreConfigFlag('recolize_recommendation_engine/general/enable_extension') === true): ?>
16
+ <?php $currentCategoryName = Mage::registry('current_category')->getName(); ?>
17
 
18
  <script type="text/javascript">
19
  var RecolizeParameters = {};
20
  RecolizeParameters['specialPageType'] = 'category';
21
+ RecolizeParameters['categoryId'] = '<?php echo $currentCategoryName ?>';
22
  </script>
23
  <?php endif; ?>
package.xml CHANGED
@@ -1,19 +1,21 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>recolize_recommendation_engine</name>
4
- <version>2.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/GPL-3.0">GNU General Public License (GPL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>The Recolize Recommendation Engine generates personalized product recommendations.</summary>
10
  <description>The Recolize Recommendation Engine is a recommendation service for shops of every size. You can integrate our extension in minutes and immediately start with personalized recommendations in your shop. No matter what size it is.</description>
11
- <notes>- Shortened the extension file paths to work correctly with the Magento Downloader file path length limit of 100 characters.&#xD;
12
- - The Recolize product feeds now get generated during the extension installation.</notes>
 
 
13
  <authors><author><name>Recolize GmbH</name><user>recolize</user><email>admin@recolize.com</email></author></authors>
14
- <date>2015-08-06</date>
15
- <time>10:40:52</time>
16
- <contents><target name="magecommunity"><dir name="Recolize"><dir name="RecommendationEngine"><dir name="Helper"><file name="Data.php" hash="b8c7aef918d25bf3a6526f92a9c87943"/></dir><file name="Installation_Instructions.pdf" hash="6dbc83b65fc75a105fd49df6294f07f1"/><file name="Installationsanleitung.pdf" hash="755bda8b121e28b25c8630ce1f222ec1"/><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="Feed.php" hash="2e47a8d51daf64b02646fe0516fd9449"/></dir></dir></dir></dir><dir name="Convert"><dir name="Mapper"><file name="Column.php" hash="2aab9f6b96ce7aa79713446f19eac9f6"/></dir><dir name="Parser"><file name="Product.php" hash="8bda25fb519231402379bf1747046906"/></dir></dir><file name="Feed.php" hash="38226d790f0934e94ddd64d13e82525c"/><file name="Observer.php" hash="4b20f6c601a99494360d55f401ec6e1c"/><file name="Session.php" hash="fb1aaea121d19480dc40b767ccecb160"/></dir><dir name="data"><dir name="recolize_re_setup"><file name="data-install-2.0.1.php" hash="a799aaa5d480c98ae0e71d78ed4437c7"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="f2ac8a1129641c29badeb635f7d6911c"/><file name="config.xml" hash="8ac0c64f5863b1851a2900282d44d41a"/><file name="system.xml" hash="c5cb569c7c87ed56ed8f7adec9dcf38b"/></dir><dir name="sql"><dir name="recolize_re_setup"><file name="mysql4-install-2.0.0.php" hash="510620d88c44344d92bb3e24d4f15438"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="layout"><file name="recolize_recommendation_engine.xml" hash="bed9cd00bf277ff3ed65b8c75bef0102"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="recolize"><dir name="recommendation_engine"><file name="add_to_cart.phtml" hash="6f710f7f464ddc9e6d9958c9fcaddba5"/><file name="add_to_cart_ajax.phtml" hash="8c80f51905b96013538a0ee068836d5a"/><file name="category_view.phtml" hash="145f8fc4f0538725c8f6ed7e662751da"/><file name="checkout_success.phtml" hash="3f634b1803428109e3c325317479ce11"/><file name="javascript_snippet.phtml" hash="5d25e641222d9da2f2e774718c799475"/><file name="product_view.phtml" hash="3658648080fb64817dbda3980a96d595"/></dir></dir></dir><dir name="layout"><file name="recolize_recommendation_engine.xml" hash="5ea7c7f18e45dade889795aaa4596ad7"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Recolize_RecommendationEngine.xml" hash="379b47272f4b53bb5c8632474cb3bce7"/></dir></target><target name="magelocale"><dir><dir name="de_DE"><file name="Recolize_RecommendationEngine.csv" hash="832b98fc60923a307229a679ebda0c7d"/></dir><dir name="en_US"><file name="Recolize_RecommendationEngine.csv" hash="85ec4bf3434c62b243f69edb26460ae5"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><dir name="recolize"><dir name="recommendation_engine"><file name="configuration.css" hash="2edfa2909522551ec139a7c55b1e0348"/></dir></dir></dir></dir></dir></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>recolize_recommendation_engine</name>
4
+ <version>2.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/GPL-3.0">GNU General Public License (GPL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>The Recolize Recommendation Engine generates personalized product recommendations.</summary>
10
  <description>The Recolize Recommendation Engine is a recommendation service for shops of every size. You can integrate our extension in minutes and immediately start with personalized recommendations in your shop. No matter what size it is.</description>
11
+ <notes>- Enabled the current category filter, which now can be used in the Recolize Tool&#xD;
12
+ - The product feed profile names are now unique in a multistore setup with same store names&#xD;
13
+ - The feed data is not aggregated anymore in a multistore setup&#xD;
14
+ - Optimized the Recolize parameters JavaScript parts to avoid conflicts with other extensions in a merged JS setup</notes>
15
  <authors><author><name>Recolize GmbH</name><user>recolize</user><email>admin@recolize.com</email></author></authors>
16
+ <date>2015-08-31</date>
17
+ <time>19:05:20</time>
18
+ <contents><target name="magecommunity"><dir name="Recolize"><dir name="RecommendationEngine"><dir name="Helper"><file name="Data.php" hash="b8c7aef918d25bf3a6526f92a9c87943"/></dir><file name="Installation_Instructions.pdf" hash="6dbc83b65fc75a105fd49df6294f07f1"/><file name="Installationsanleitung.pdf" hash="755bda8b121e28b25c8630ce1f222ec1"/><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="Feed.php" hash="2e47a8d51daf64b02646fe0516fd9449"/></dir></dir></dir></dir><dir name="Convert"><dir name="Mapper"><file name="Column.php" hash="2aab9f6b96ce7aa79713446f19eac9f6"/></dir><dir name="Parser"><file name="Product.php" hash="8bda25fb519231402379bf1747046906"/></dir></dir><file name="Feed.php" hash="8cfae5a6d8dcd2dc4ec9c5d53f1cf56d"/><file name="Observer.php" hash="4b20f6c601a99494360d55f401ec6e1c"/><file name="Session.php" hash="fb1aaea121d19480dc40b767ccecb160"/></dir><dir name="data"><dir name="recolize_re_setup"><file name="data-install-2.0.1.php" hash="91325d474359f9f4bbaf5ae96954d8d6"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="f2ac8a1129641c29badeb635f7d6911c"/><file name="config.xml" hash="103dfba4877911bb62a7ff13a4817f75"/><file name="system.xml" hash="c5cb569c7c87ed56ed8f7adec9dcf38b"/></dir><dir name="sql"><dir name="recolize_re_setup"><file name="mysql4-install-2.0.0.php" hash="cd2fcf1924cd80c155e23e0448db1712"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="layout"><file name="recolize_recommendation_engine.xml" hash="bed9cd00bf277ff3ed65b8c75bef0102"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="recolize"><dir name="recommendation_engine"><file name="add_to_cart.phtml" hash="5522b2958067b9be887b095d77d954c7"/><file name="add_to_cart_ajax.phtml" hash="8c7bb471f6e410938a2eab11c5090272"/><file name="category_view.phtml" hash="8c6888f03756d3c6198afc43dc3a7480"/><file name="checkout_success.phtml" hash="3f634b1803428109e3c325317479ce11"/><file name="javascript_snippet.phtml" hash="5d25e641222d9da2f2e774718c799475"/><file name="product_view.phtml" hash="3658648080fb64817dbda3980a96d595"/></dir></dir></dir><dir name="layout"><file name="recolize_recommendation_engine.xml" hash="5ea7c7f18e45dade889795aaa4596ad7"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Recolize_RecommendationEngine.xml" hash="379b47272f4b53bb5c8632474cb3bce7"/></dir></target><target name="magelocale"><dir><dir name="de_DE"><file name="Recolize_RecommendationEngine.csv" hash="832b98fc60923a307229a679ebda0c7d"/></dir><dir name="en_US"><file name="Recolize_RecommendationEngine.csv" hash="85ec4bf3434c62b243f69edb26460ae5"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><dir name="recolize"><dir name="recommendation_engine"><file name="configuration.css" hash="2edfa2909522551ec139a7c55b1e0348"/></dir></dir></dir></dir></dir></dir></target></contents>
19
  <compatible/>
20
  <dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php></required></dependencies>
21
  </package>