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 | 2.1.1 |
| Comparing to | |
| See all releases | |
Code changes from version 2.1.0 to 2.1.1
- app/code/community/CommerceStack/Recommender/Block/Cart/Crosssell.php +3 -3
- app/code/community/CommerceStack/Recommender/Block/Product/List/Related.php +6 -3
- app/code/community/CommerceStack/Recommender/Block/Product/List/Upsell.php +11 -4
- app/code/community/CommerceStack/Recommender/controllers/IndexController.php +24 -0
- package.xml +4 -4
app/code/community/CommerceStack/Recommender/Block/Cart/Crosssell.php
CHANGED
|
@@ -109,7 +109,7 @@ class CommerceStack_Recommender_Block_Cart_Crosssell extends Mage_Checkout_Block
|
|
| 109 |
}
|
| 110 |
|
| 111 |
|
| 112 |
-
if(count($unionLinkedItemCollection) < $limit)
|
| 113 |
{
|
| 114 |
// Get categories for randoms
|
| 115 |
$cartProducts = $this->getQuote()->getAllItems();
|
|
@@ -122,7 +122,7 @@ class CommerceStack_Recommender_Block_Cart_Crosssell extends Mage_Checkout_Block
|
|
| 122 |
$useCategoryFilter = !is_null($category) && $constrainCategory;
|
| 123 |
}
|
| 124 |
|
| 125 |
-
while(count($unionLinkedItemCollection) < $limit)
|
| 126 |
{
|
| 127 |
// We still don't have enough recommendations. Fill out the remaining with randoms.
|
| 128 |
$numRecsToGet = $limit - count($unionLinkedItemCollection);
|
|
@@ -153,7 +153,7 @@ class CommerceStack_Recommender_Block_Cart_Crosssell extends Mage_Checkout_Block
|
|
| 153 |
if(is_null($category->getId())) $useCategoryFilter = false;
|
| 154 |
}
|
| 155 |
|
| 156 |
-
foreach
|
| 157 |
{
|
| 158 |
$items[] = $item;
|
| 159 |
}
|
| 109 |
}
|
| 110 |
|
| 111 |
|
| 112 |
+
if(@count($unionLinkedItemCollection) < $limit)
|
| 113 |
{
|
| 114 |
// Get categories for randoms
|
| 115 |
$cartProducts = $this->getQuote()->getAllItems();
|
| 122 |
$useCategoryFilter = !is_null($category) && $constrainCategory;
|
| 123 |
}
|
| 124 |
|
| 125 |
+
while(@count($unionLinkedItemCollection) < $limit)
|
| 126 |
{
|
| 127 |
// We still don't have enough recommendations. Fill out the remaining with randoms.
|
| 128 |
$numRecsToGet = $limit - count($unionLinkedItemCollection);
|
| 153 |
if(is_null($category->getId())) $useCategoryFilter = false;
|
| 154 |
}
|
| 155 |
|
| 156 |
+
foreach(@$unionLinkedItemCollection as $item)
|
| 157 |
{
|
| 158 |
$items[] = $item;
|
| 159 |
}
|
app/code/community/CommerceStack/Recommender/Block/Product/List/Related.php
CHANGED
|
@@ -41,9 +41,12 @@ class CommerceStack_Recommender_Block_Product_List_Related extends Mage_Catalog_
|
|
| 41 |
// This could be a recently viewed or a search page. Try to get category collection and arbitrarily use first
|
| 42 |
/* @var $currentProduct Mage_Catalog_Model_Product */
|
| 43 |
$currentProduct = Mage::registry('current_product');
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
| 47 |
}
|
| 48 |
$useCategoryFilter = !is_null($currentCategory) && $constrainCategory;
|
| 49 |
|
| 41 |
// This could be a recently viewed or a search page. Try to get category collection and arbitrarily use first
|
| 42 |
/* @var $currentProduct Mage_Catalog_Model_Product */
|
| 43 |
$currentProduct = Mage::registry('current_product');
|
| 44 |
+
if (is_object($currentProduct))
|
| 45 |
+
{
|
| 46 |
+
$currentCategory = $currentProduct->getCategoryCollection();
|
| 47 |
+
$productCategory = $currentCategory->getFirstItem();
|
| 48 |
+
$currentCategory = $productCategory;
|
| 49 |
+
}
|
| 50 |
}
|
| 51 |
$useCategoryFilter = !is_null($currentCategory) && $constrainCategory;
|
| 52 |
|
app/code/community/CommerceStack/Recommender/Block/Product/List/Upsell.php
CHANGED
|
@@ -36,15 +36,22 @@ class CommerceStack_Recommender_Block_Product_List_Upsell extends Mage_Catalog_B
|
|
| 36 |
// Figure out if we should use a category filter
|
| 37 |
$constrainCategory = Mage::getStoreConfig('recommender/relatedproducts/constraincategory');
|
| 38 |
$currentCategory = Mage::registry('current_category');
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
if(is_null($currentCategory))
|
| 41 |
{
|
| 42 |
// This could be a recently viewed or a search page. Try to get category collection and arbitrarily use first
|
| 43 |
/* @var $currentProduct Mage_Catalog_Model_Product */
|
| 44 |
$currentProduct = Mage::registry('current_product');
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
| 48 |
}
|
| 49 |
$useCategoryFilter = !is_null($currentCategory) && $constrainCategory;
|
| 50 |
|
| 36 |
// Figure out if we should use a category filter
|
| 37 |
$constrainCategory = Mage::getStoreConfig('recommender/relatedproducts/constraincategory');
|
| 38 |
$currentCategory = Mage::registry('current_category');
|
| 39 |
+
if (is_object($currentCategory))
|
| 40 |
+
{
|
| 41 |
+
$productCategory = $currentCategory;
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
if(is_null($currentCategory))
|
| 45 |
{
|
| 46 |
// This could be a recently viewed or a search page. Try to get category collection and arbitrarily use first
|
| 47 |
/* @var $currentProduct Mage_Catalog_Model_Product */
|
| 48 |
$currentProduct = Mage::registry('current_product');
|
| 49 |
+
if (is_object($currentProduct))
|
| 50 |
+
{
|
| 51 |
+
$currentCategory = $currentProduct->getCategoryCollection();
|
| 52 |
+
$productCategory = $currentCategory->getFirstItem();
|
| 53 |
+
$currentCategory = $productCategory;
|
| 54 |
+
}
|
| 55 |
}
|
| 56 |
$useCategoryFilter = !is_null($currentCategory) && $constrainCategory;
|
| 57 |
|
app/code/community/CommerceStack/Recommender/controllers/IndexController.php
CHANGED
|
@@ -26,6 +26,8 @@ class CommerceStack_Recommender_IndexController extends Mage_Core_Controller_Fro
|
|
| 26 |
'item_id');
|
| 27 |
|
| 28 |
echo $maxId;
|
|
|
|
|
|
|
| 29 |
}
|
| 30 |
|
| 31 |
public function orderitemAction()
|
|
@@ -47,6 +49,8 @@ class CommerceStack_Recommender_IndexController extends Mage_Core_Controller_Fro
|
|
| 47 |
);
|
| 48 |
|
| 49 |
echo $xml;
|
|
|
|
|
|
|
| 50 |
}
|
| 51 |
|
| 52 |
public function logcustomerMaxIdAction()
|
|
@@ -63,6 +67,8 @@ class CommerceStack_Recommender_IndexController extends Mage_Core_Controller_Fro
|
|
| 63 |
'log_id');
|
| 64 |
|
| 65 |
echo $maxId;
|
|
|
|
|
|
|
| 66 |
}
|
| 67 |
|
| 68 |
public function logcustomerAction()
|
|
@@ -84,6 +90,8 @@ class CommerceStack_Recommender_IndexController extends Mage_Core_Controller_Fro
|
|
| 84 |
);
|
| 85 |
|
| 86 |
echo $xml;
|
|
|
|
|
|
|
| 87 |
}
|
| 88 |
|
| 89 |
public function logurlinfoMaxIdAction()
|
|
@@ -100,6 +108,8 @@ class CommerceStack_Recommender_IndexController extends Mage_Core_Controller_Fro
|
|
| 100 |
'url_id');
|
| 101 |
|
| 102 |
echo $maxId;
|
|
|
|
|
|
|
| 103 |
}
|
| 104 |
|
| 105 |
public function logurlinfoAction()
|
|
@@ -121,6 +131,8 @@ class CommerceStack_Recommender_IndexController extends Mage_Core_Controller_Fro
|
|
| 121 |
);
|
| 122 |
|
| 123 |
echo $xml;
|
|
|
|
|
|
|
| 124 |
}
|
| 125 |
|
| 126 |
public function logurlMaxIdAction()
|
|
@@ -137,6 +149,8 @@ class CommerceStack_Recommender_IndexController extends Mage_Core_Controller_Fro
|
|
| 137 |
'url_id');
|
| 138 |
|
| 139 |
echo $maxId;
|
|
|
|
|
|
|
| 140 |
}
|
| 141 |
|
| 142 |
public function logurlAction()
|
|
@@ -158,6 +172,8 @@ class CommerceStack_Recommender_IndexController extends Mage_Core_Controller_Fro
|
|
| 158 |
);
|
| 159 |
|
| 160 |
echo $xml;
|
|
|
|
|
|
|
| 161 |
}
|
| 162 |
|
| 163 |
public function urlrewriteMaxIdAction()
|
|
@@ -174,6 +190,8 @@ class CommerceStack_Recommender_IndexController extends Mage_Core_Controller_Fro
|
|
| 174 |
'url_rewrite_id');
|
| 175 |
|
| 176 |
echo $maxId;
|
|
|
|
|
|
|
| 177 |
}
|
| 178 |
|
| 179 |
public function urlrewriteAction()
|
|
@@ -197,6 +215,8 @@ class CommerceStack_Recommender_IndexController extends Mage_Core_Controller_Fro
|
|
| 197 |
);
|
| 198 |
|
| 199 |
echo $xml;
|
|
|
|
|
|
|
| 200 |
}
|
| 201 |
|
| 202 |
public function producturlMaxIdAction()
|
|
@@ -213,6 +233,8 @@ class CommerceStack_Recommender_IndexController extends Mage_Core_Controller_Fro
|
|
| 213 |
'value_id');
|
| 214 |
|
| 215 |
echo $maxId;
|
|
|
|
|
|
|
| 216 |
}
|
| 217 |
|
| 218 |
public function producturlAction()
|
|
@@ -236,6 +258,8 @@ class CommerceStack_Recommender_IndexController extends Mage_Core_Controller_Fro
|
|
| 236 |
);
|
| 237 |
|
| 238 |
echo $xml;
|
|
|
|
|
|
|
| 239 |
}
|
| 240 |
|
| 241 |
public function syncAction()
|
| 26 |
'item_id');
|
| 27 |
|
| 28 |
echo $maxId;
|
| 29 |
+
|
| 30 |
+
exit(); // Suppress any cache displays or other extension processing
|
| 31 |
}
|
| 32 |
|
| 33 |
public function orderitemAction()
|
| 49 |
);
|
| 50 |
|
| 51 |
echo $xml;
|
| 52 |
+
|
| 53 |
+
exit(); // Suppress any cache displays or other extension processing
|
| 54 |
}
|
| 55 |
|
| 56 |
public function logcustomerMaxIdAction()
|
| 67 |
'log_id');
|
| 68 |
|
| 69 |
echo $maxId;
|
| 70 |
+
|
| 71 |
+
exit(); // Suppress any cache displays or other extension processing
|
| 72 |
}
|
| 73 |
|
| 74 |
public function logcustomerAction()
|
| 90 |
);
|
| 91 |
|
| 92 |
echo $xml;
|
| 93 |
+
|
| 94 |
+
exit(); // Suppress any cache displays or other extension processing
|
| 95 |
}
|
| 96 |
|
| 97 |
public function logurlinfoMaxIdAction()
|
| 108 |
'url_id');
|
| 109 |
|
| 110 |
echo $maxId;
|
| 111 |
+
|
| 112 |
+
exit(); // Suppress any cache displays or other extension processing
|
| 113 |
}
|
| 114 |
|
| 115 |
public function logurlinfoAction()
|
| 131 |
);
|
| 132 |
|
| 133 |
echo $xml;
|
| 134 |
+
|
| 135 |
+
exit(); // Suppress any cache displays or other extension processing
|
| 136 |
}
|
| 137 |
|
| 138 |
public function logurlMaxIdAction()
|
| 149 |
'url_id');
|
| 150 |
|
| 151 |
echo $maxId;
|
| 152 |
+
|
| 153 |
+
exit(); // Suppress any cache displays or other extension processing
|
| 154 |
}
|
| 155 |
|
| 156 |
public function logurlAction()
|
| 172 |
);
|
| 173 |
|
| 174 |
echo $xml;
|
| 175 |
+
|
| 176 |
+
exit(); // Suppress any cache displays or other extension processing
|
| 177 |
}
|
| 178 |
|
| 179 |
public function urlrewriteMaxIdAction()
|
| 190 |
'url_rewrite_id');
|
| 191 |
|
| 192 |
echo $maxId;
|
| 193 |
+
|
| 194 |
+
exit(); // Suppress any cache displays or other extension processing
|
| 195 |
}
|
| 196 |
|
| 197 |
public function urlrewriteAction()
|
| 215 |
);
|
| 216 |
|
| 217 |
echo $xml;
|
| 218 |
+
|
| 219 |
+
exit(); // Suppress any cache displays or other extension processing
|
| 220 |
}
|
| 221 |
|
| 222 |
public function producturlMaxIdAction()
|
| 233 |
'value_id');
|
| 234 |
|
| 235 |
echo $maxId;
|
| 236 |
+
|
| 237 |
+
exit(); // Suppress any cache displays or other extension processing
|
| 238 |
}
|
| 239 |
|
| 240 |
public function producturlAction()
|
| 258 |
);
|
| 259 |
|
| 260 |
echo $xml;
|
| 261 |
+
|
| 262 |
+
exit(); // Suppress any cache displays or other extension processing
|
| 263 |
}
|
| 264 |
|
| 265 |
public function syncAction()
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>CommerceStack_Recommender</name>
|
| 4 |
-
<version>2.1.
|
| 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->Configuration->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>2013-
|
| 20 |
-
<time>
|
| 21 |
-
<contents><target name="magecommunity"><dir name="CommerceStack"><dir name="Recommender"><dir name="Block"><dir name="Cart"><file name="Crosssell.php" hash="
|
| 22 |
<compatible/>
|
| 23 |
<dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php></required></dependencies>
|
| 24 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>CommerceStack_Recommender</name>
|
| 4 |
+
<version>2.1.1</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->Configuration->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>2013-07-15</date>
|
| 20 |
+
<time>17:29:11</time>
|
| 21 |
+
<contents><target name="magecommunity"><dir name="CommerceStack"><dir name="Recommender"><dir name="Block"><dir name="Cart"><file name="Crosssell.php" hash="3502a27a963955eb91cf8165a39af9d5"/></dir><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><file name="Crosssell.php" hash="6bf054a0c4cb02d5029e865c1f834d65"/><file name="Related.php" hash="0daa5a8c523d389eaea2d1d220d96be9"/></dir><file name="Tabs.php" hash="aa26d6e9e585117100e983616e6a0afa"/></dir></dir></dir><dir name="Product"><dir name="List"><file name="Related.php" hash="597516550d0a8d532f668925d59bbb35"/><file name="Upsell.php" hash="732271208e08ddda4567029cd1382e84"/></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><file name="Apikey.php" hash="def235a2710cea0b01ace89bce9ffda4"/><file name="Apikeyurl.php" hash="5ce3031fd84f912b3552d7c37f2a04ac"/><file name="Apisecret.php" hash="9b9a92981a5ff80aa4ec3e4255844801"/><file name="Apiuser.php" hash="bba5a87192ab0821d999aa4ab8cddada"/><file name="Cancelbutton.php" hash="7a87871461a6d589a28ccbc18f9d1603"/><file name="Email.php" hash="0231900a317a75e1f72cfdd440df2e45"/><file name="Helpiframe.php" hash="cd049db20bfa53e6a57eaba796a0f5b6"/><file name="Paymentiframe.php" hash="aac32f6d47bf80aef61c1b4288363f7e"/><file name="Updatebutton.php" hash="997d957fab4ac828237b9b0ca92d51e6"/></dir><file name="Form.php" hash="de1c3b70b03ac09fe1d5c7cd7613feb1"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="f522b3fa9caa77c3ab85e448382ff469"/></dir><dir name="Model"><dir name="Product"><file name="Link.php" hash="c2fb978783910af6472fbcf50070bb0f"/></dir><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><dir name="Product"><dir name="Link"><dir name="Product"><file name="Collection.php" hash="3fb32d0da982297829938dc2427b35cb"/></dir></dir><file name="Link.php" hash="0910e13e6a3b3cac3573a4ea1df59e9f"/></dir></dir></dir><dir name="Mysql4"><file name="Setup.php" hash="1e93566c0f56cc52cdf4e4a73153d2f9"/></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="2ba2f4ae67df9a140ed2b8b5bc4ec986"/><file name="IndexController.php" hash="2a60213f638ebd16d051d83d3d8f726c"/><file name="ProductController.php" hash="83ad4a8d6d22d53f4fb03744950500d9"/></dir><dir name="etc"><file name="config.xml" hash="a2c3e600bd4c1cb1d05c738c18aed2e4"/><file name="system.xml" hash="2ee1ffb7b78936caf27acc87bc34a4c9"/></dir><dir name="sql"><dir name="recommender_setup"><file name="mysql4-install-0.9.3.php" hash="cfe38102d96814f6b254cc38c07f2037"/><file name="mysql4-upgrade-0.9.3-0.9.4.php" hash="3beefb00777a6bd04265b7d33c23efa9"/><file name="mysql4-upgrade-0.9.4-0.9.5.php" hash="3beefb00777a6bd04265b7d33c23efa9"/><file name="mysql4-upgrade-0.9.5-1.0.0.php" hash="3beefb00777a6bd04265b7d33c23efa9"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="3beefb00777a6bd04265b7d33c23efa9"/><file name="mysql4-upgrade-1.0.1-1.0.2.php" hash="3beefb00777a6bd04265b7d33c23efa9"/><file name="mysql4-upgrade-1.0.2-1.1.0.php" hash="3beefb00777a6bd04265b7d33c23efa9"/><file name="mysql4-upgrade-1.1.0-1.2.0.php" hash="3beefb00777a6bd04265b7d33c23efa9"/><file name="mysql4-upgrade-1.2.0-1.2.1.php" hash="3beefb00777a6bd04265b7d33c23efa9"/><file name="mysql4-upgrade-1.2.1-1.2.2.php" hash="3beefb00777a6bd04265b7d33c23efa9"/><file name="mysql4-upgrade-1.2.2-1.2.3.php" hash="3beefb00777a6bd04265b7d33c23efa9"/><file name="mysql4-upgrade-1.2.3-1.2.4.php" hash="3beefb00777a6bd04265b7d33c23efa9"/><file name="mysql4-upgrade-1.2.4-1.2.5.php" hash="3beefb00777a6bd04265b7d33c23efa9"/><file name="mysql4-upgrade-1.2.5-1.2.6.php" hash="3beefb00777a6bd04265b7d33c23efa9"/><file name="mysql4-upgrade-1.2.6-2.0.0.php" hash="b2d2b463578d50b2a1a313c36d02ecdf"/></dir></dir></dir><dir name="CsApiClient"><dir name="Model"><file name="Account.php" hash="b463d405e9e6bc18c1ce27dc98992a61"/><file name="Server.php" hash="6dd11dab8794ab53cdb763d4820d36c9"/></dir><dir name="etc"><file name="config.xml" hash="5734d20ccb8807ea84041bf44620fa7c"/></dir></dir><dir name="CsNotification"><dir name="Model"><dir name="AdminNotification"><file name="Feed.php" hash="1f20e704fe895c4a2748612a028ee186"/></dir></dir><dir name="etc"><file name="config.xml" hash="9ede9a59b2e857828a341bbf53953abe"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="recommender.xml" hash="26d8deea180738fdd5e3f0a5bcbc8f07"/></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="commercestack"><dir name="adminhtml"><file name="recommender.js" hash="b9b1fb4afa53aeb99d3a180f9fafc155"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="CommerceStack_Recommender.xml" hash="c0faaf57bb93c70fe6ba45e68c96fc11"/><file name="CommerceStack_CsApiClient.xml" hash="dd56312764a58b18b7e21738ebb8a6b0"/><file name="CommerceStack_CsNotification.xml" hash="94bb10db3af629c7e68bbf32fd18159c"/></dir></target></contents>
|
| 22 |
<compatible/>
|
| 23 |
<dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php></required></dependencies>
|
| 24 |
</package>
|
