CommerceStack_Recommender - Version 1.2.5

Version Notes

Please contact help@commercestack.com with any feature requests, bugs, issues, or questions.

Download this release

Release Info

Developer CommerceStack
Extension CommerceStack_Recommender
Version 1.2.5
Comparing to
See all releases


Code changes from version 1.2.4 to 1.2.5

app/code/community/CommerceStack/Recommender/Block/Cart/Crosssell.php CHANGED
@@ -45,6 +45,15 @@ class CommerceStack_Recommender_Block_Cart_Crosssell extends Mage_Checkout_Block
45
  }
46
 
47
  $limit = Mage::getStoreConfig('recommender/relatedproducts/numberofcrosssellproducts') - count($items);
 
 
 
 
 
 
 
 
 
48
 
49
  if (count($items) > $limit)
50
  {
45
  }
46
 
47
  $limit = Mage::getStoreConfig('recommender/relatedproducts/numberofcrosssellproducts') - count($items);
48
+
49
+ // A bit of a hack, but return an empty collection if user selected 0 recommendations to show in config
50
+ if($limit < 1)
51
+ {
52
+ $this->_itemCollection = $this->_getCollection($this->_linkSource[0]);
53
+ $this->_itemCollection->load();
54
+ $this->_itemCollection->clear();
55
+ return $this;
56
+ }
57
 
58
  if (count($items) > $limit)
59
  {
app/code/community/CommerceStack/Recommender/Block/Product/List/Related.php CHANGED
@@ -7,10 +7,19 @@ class CommerceStack_Recommender_Block_Product_List_Related extends Mage_Catalog_
7
  protected function _prepareData()
8
  {
9
  $limit = Mage::getStoreConfig('recommender/relatedproducts/numberofrelatedproducts');
10
-
11
  /* @var $product Mage_Catalog_Model_Product */
12
  $product = Mage::registry('product');
13
 
 
 
 
 
 
 
 
 
 
14
  $unionLinkedItemCollection = null;
15
  foreach($this->_linkSource as $linkSource)
16
  {
@@ -112,6 +121,7 @@ class CommerceStack_Recommender_Block_Product_List_Related extends Mage_Catalog_
112
 
113
  $this->_itemCollection = $unionLinkedItemCollection;
114
 
 
115
  foreach ($this->_itemCollection as $product) {
116
  $product->setDoNotUseCategoryId(true);
117
  }
7
  protected function _prepareData()
8
  {
9
  $limit = Mage::getStoreConfig('recommender/relatedproducts/numberofrelatedproducts');
10
+
11
  /* @var $product Mage_Catalog_Model_Product */
12
  $product = Mage::registry('product');
13
 
14
+ // A bit of a hack, but return an empty collection if user selected 0 recommendations to show in config
15
+ if($limit < 1)
16
+ {
17
+ $this->_itemCollection = $product->getRelatedProductCollection();
18
+ $this->_itemCollection->load();
19
+ $this->_itemCollection->clear();
20
+ return $this;
21
+ }
22
+
23
  $unionLinkedItemCollection = null;
24
  foreach($this->_linkSource as $linkSource)
25
  {
121
 
122
  $this->_itemCollection = $unionLinkedItemCollection;
123
 
124
+
125
  foreach ($this->_itemCollection as $product) {
126
  $product->setDoNotUseCategoryId(true);
127
  }
app/code/community/CommerceStack/Recommender/Block/Product/List/Upsell.php CHANGED
@@ -19,6 +19,15 @@ class CommerceStack_Recommender_Block_Product_List_Upsell extends Mage_Catalog_B
19
  /* @var $product Mage_Catalog_Model_Product */
20
  $product = Mage::registry('product');
21
 
 
 
 
 
 
 
 
 
 
22
  $unionLinkedItemCollection = null;
23
  foreach($this->_linkSource as $linkSource)
24
  {
19
  /* @var $product Mage_Catalog_Model_Product */
20
  $product = Mage::registry('product');
21
 
22
+ // A bit of a hack, but return an empty collection if user selected 0 recommendations to show in config
23
+ if($limit < 1)
24
+ {
25
+ $this->_itemCollection = $product->getRelatedProductCollection();
26
+ $this->_itemCollection->load();
27
+ $this->_itemCollection->clear();
28
+ return $this;
29
+ }
30
+
31
  $unionLinkedItemCollection = null;
32
  foreach($this->_linkSource as $linkSource)
33
  {
app/code/community/CommerceStack/Recommender/Model/Resource/Eav/Mysql4/Product/Link/Product/Collection.php CHANGED
@@ -83,6 +83,11 @@ class CommerceStack_Recommender_Model_Resource_Eav_Mysql4_Product_Link_Product_C
83
  // $limit and $offset are ignored and are for compatibility with parent class only
84
  return array_keys($this->getItems());
85
  }
 
 
 
 
 
86
 
87
 
88
  }
83
  // $limit and $offset are ignored and are for compatibility with parent class only
84
  return array_keys($this->getItems());
85
  }
86
+
87
+ public function clear()
88
+ {
89
+ $this->_items = array();
90
+ }
91
 
92
 
93
  }
app/code/community/CommerceStack/Recommender/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <CommerceStack_Recommender>
5
- <version>1.2.4</version>
6
  </CommerceStack_Recommender>
7
  </modules>
8
 
2
  <config>
3
  <modules>
4
  <CommerceStack_Recommender>
5
+ <version>1.2.5</version>
6
  </CommerceStack_Recommender>
7
  </modules>
8
 
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>CommerceStack_Recommender</name>
4
- <version>1.2.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License v 3.0</license>
7
  <channel>community</channel>
@@ -16,9 +16,9 @@ Please contact help@commercestack.com with any bugs, issues, or feature requests
16
  After installing, navigate to System-&gt;Configuration-&gt;Related Products Manager to begin.</description>
17
  <notes>Please contact help@commercestack.com with any feature requests, bugs, issues, or questions.</notes>
18
  <authors><author><name>CommerceStack</name><user>dbright</user><email>dbright@commercestack.com</email></author></authors>
19
- <date>2012-06-12</date>
20
- <time>18:52:09</time>
21
- <contents><target name="magecommunity"><dir name="CommerceStack"><dir name="Recommender"><dir name="Block"><dir name="Cart"><file name="Crosssell.php" hash="f931d15f47b6390cc6b2d3c86a2df030"/></dir><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><file name="Crosssell.php" hash="4eacb2e01e0ec6ead7109fe696fc2e23"/><file name="Related.php" hash="3469e281271de8f9457f82fdc90ca104"/></dir><file name="Tabs.php" hash="aa26d6e9e585117100e983616e6a0afa"/></dir></dir></dir><dir name="Product"><dir name="List"><file name="Related.php" hash="10398409402120307ec7f24b7d396b40"/><file name="Upsell.php" hash="4edc3dd9e8cb5e946a0309494bc53e99"/></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><file name="Apikey.php" hash="fae5b45d9eace7c2934b9f70f5ec6c8e"/><file name="Apikeyurl.php" hash="5ce3031fd84f912b3552d7c37f2a04ac"/><file name="Cancelbutton.php" hash="070131f41c4969cf51917b486e487b26"/><file name="Updatebutton.php" hash="2a370f132bc2b6fc5d21f2f477b6115e"/></dir><file name="Form.php" hash="de1c3b70b03ac09fe1d5c7cd7613feb1"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="11fc78bfbae0c85e8acc512d3978efea"/><dir name="Pest"><file name="PestJSON.php" hash="95059011a55bd0036c5029ba5b2d0f0c"/><file name="PestXML.php" hash="7e8e2a8c75b8a58d11bef9c47b4e960d"/></dir><file name="Pest.php" hash="15ac0a66957144f848b067c11710204d"/></dir><dir name="Model"><dir name="AdminNotification"><file name="Feed.php" hash="bf32debf65f8e5ca5371843333730b02"/></dir><dir name="Product"><file name="Link.php" hash="0e08ed99339e2acd77cce3e738cdbfae"/></dir><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><dir name="Product"><dir name="Link"><dir name="Product"><file name="Collection.php" hash="ebf570a39f98b982d09a60f3af1768df"/></dir></dir><file name="Link.php" hash="0910e13e6a3b3cac3573a4ea1df59e9f"/></dir></dir></dir><dir name="Mysql4"><file name="Setup.php" hash="79f3bcb4122135514d6f68f3db50b9f1"/></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><file name="Upsellsource.php" hash="34ed5e3c61bd288340b7de3809953ad3"/></dir></dir></dir></dir><dir name="controllers"><file name="AccountController.php" hash="05af8f614f7822b480b9b9e55b25d45e"/><file name="IndexController.php" hash="ef4908d883c30972e490f67d9d9cbe3d"/><file name="ProductController.php" hash="fb4235ad3604eaeaee7e8e0e1fe71f04"/></dir><dir name="etc"><file name="config.xml" hash="04a9fc655ef9e6875450cb20fa0461bd"/><file name="system.xml" hash="089389d636f112dbead01f1be6c656a8"/></dir><dir name="sql"><dir name="recommender_setup"><file name="mysql4-install-0.9.3.php" hash="d72ccc127f8f2ccef5216e7eaf62babc"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="recommender.xml" hash="f19e768264b836355637a61d6a1463f5"/></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="commercestack"><dir name="adminhtml"><file name="recommender.js" hash="6e99f78c4b6e495401cdb4ece6f699ca"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="CommerceStack_Recommender.xml" hash="c0faaf57bb93c70fe6ba45e68c96fc11"/></dir></target></contents>
22
  <compatible/>
23
  <dependencies><required><php><min>5.2.13</min><max>5.4.0</max></php></required></dependencies>
24
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>CommerceStack_Recommender</name>
4
+ <version>1.2.5</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License v 3.0</license>
7
  <channel>community</channel>
16
  After installing, navigate to System-&gt;Configuration-&gt;Related Products Manager to begin.</description>
17
  <notes>Please contact help@commercestack.com with any feature requests, bugs, issues, or questions.</notes>
18
  <authors><author><name>CommerceStack</name><user>dbright</user><email>dbright@commercestack.com</email></author></authors>
19
+ <date>2012-06-14</date>
20
+ <time>23:24:25</time>
21
+ <contents><target name="magecommunity"><dir name="CommerceStack"><dir name="Recommender"><dir name="Block"><dir name="Cart"><file name="Crosssell.php" hash="0a883c70bfefa375198671d4d6680295"/></dir><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><file name="Crosssell.php" hash="4eacb2e01e0ec6ead7109fe696fc2e23"/><file name="Related.php" hash="3469e281271de8f9457f82fdc90ca104"/></dir><file name="Tabs.php" hash="aa26d6e9e585117100e983616e6a0afa"/></dir></dir></dir><dir name="Product"><dir name="List"><file name="Related.php" hash="77b7d87ca7233e14f54cf67c48182fc6"/><file name="Upsell.php" hash="25444a6ea7a2781f68e2fc0b3b249565"/></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><file name="Apikey.php" hash="fae5b45d9eace7c2934b9f70f5ec6c8e"/><file name="Apikeyurl.php" hash="5ce3031fd84f912b3552d7c37f2a04ac"/><file name="Cancelbutton.php" hash="070131f41c4969cf51917b486e487b26"/><file name="Updatebutton.php" hash="2a370f132bc2b6fc5d21f2f477b6115e"/></dir><file name="Form.php" hash="de1c3b70b03ac09fe1d5c7cd7613feb1"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="11fc78bfbae0c85e8acc512d3978efea"/><dir name="Pest"><file name="PestJSON.php" hash="95059011a55bd0036c5029ba5b2d0f0c"/><file name="PestXML.php" hash="7e8e2a8c75b8a58d11bef9c47b4e960d"/></dir><file name="Pest.php" hash="15ac0a66957144f848b067c11710204d"/></dir><dir name="Model"><dir name="AdminNotification"><file name="Feed.php" hash="bf32debf65f8e5ca5371843333730b02"/></dir><dir name="Product"><file name="Link.php" hash="0e08ed99339e2acd77cce3e738cdbfae"/></dir><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><dir name="Product"><dir name="Link"><dir name="Product"><file name="Collection.php" hash="0b92801bb560760dce1b2d3ab3f7aa18"/></dir></dir><file name="Link.php" hash="0910e13e6a3b3cac3573a4ea1df59e9f"/></dir></dir></dir><dir name="Mysql4"><file name="Setup.php" hash="79f3bcb4122135514d6f68f3db50b9f1"/></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><file name="Upsellsource.php" hash="34ed5e3c61bd288340b7de3809953ad3"/></dir></dir></dir></dir><dir name="controllers"><file name="AccountController.php" hash="05af8f614f7822b480b9b9e55b25d45e"/><file name="IndexController.php" hash="ef4908d883c30972e490f67d9d9cbe3d"/><file name="ProductController.php" hash="fb4235ad3604eaeaee7e8e0e1fe71f04"/></dir><dir name="etc"><file name="config.xml" hash="21029b68d03d56b641dccb95a7d983a4"/><file name="system.xml" hash="089389d636f112dbead01f1be6c656a8"/></dir><dir name="sql"><dir name="recommender_setup"><file name="mysql4-install-0.9.3.php" hash="d72ccc127f8f2ccef5216e7eaf62babc"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="recommender.xml" hash="f19e768264b836355637a61d6a1463f5"/></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="commercestack"><dir name="adminhtml"><file name="recommender.js" hash="6e99f78c4b6e495401cdb4ece6f699ca"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="CommerceStack_Recommender.xml" hash="c0faaf57bb93c70fe6ba45e68c96fc11"/></dir></target></contents>
22
  <compatible/>
23
  <dependencies><required><php><min>5.2.13</min><max>5.4.0</max></php></required></dependencies>
24
  </package>