Version Notes
Expertrec Recommendation plugin for magento sites.
Download this release
Release Info
Developer | melchi |
Extension | Expertrec_Recommendation |
Version | 1.1.2 |
Comparing to | |
See all releases |
Code changes from version 1.1.0 to 1.1.2
- app/code/community/Expertrec/Recommendation/Block/Product/List/Toolbar.php +35 -0
- app/code/community/Expertrec/Recommendation/Model/Catalogsearch/Layer.php +15 -1
- app/code/community/Expertrec/Recommendation/controllers/ApiController.php +2 -3
- app/code/community/Expertrec/Recommendation/etc/config.xml +7 -2
- package.xml +7 -6
app/code/community/Expertrec/Recommendation/Block/Product/List/Toolbar.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Expertrec_Recommendation_Block_Product_List_Toolbar extends Mage_Catalog_Block_Product_List_Toolbar {
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Set collection to pager, overriding this function
|
7 |
+
*To ignore relevance
|
8 |
+
*
|
9 |
+
* @param Varien_Data_Collection $collection
|
10 |
+
* @return Mage_Catalog_Block_Product_List_Toolbar
|
11 |
+
*/
|
12 |
+
public function setCollection($collection)
|
13 |
+
{
|
14 |
+
$this->_collection = $collection;
|
15 |
+
|
16 |
+
$this->_collection->setCurPage($this->getCurrentPage());
|
17 |
+
|
18 |
+
// we need to set pagination only if passed value integer and more that 0
|
19 |
+
$limit = (int)$this->getLimit();
|
20 |
+
if ($limit) {
|
21 |
+
$this->_collection->setPageSize($limit);
|
22 |
+
}
|
23 |
+
if ($this->getCurrentOrder() != "relevance") {
|
24 |
+
|
25 |
+
Mage::getSingleton('expertrec_recommendation/log')->log(" I have received order from Magento ".print_r($this->getCurrentOrder(),1),null);
|
26 |
+
$this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
|
27 |
+
|
28 |
+
}
|
29 |
+
|
30 |
+
return $this;
|
31 |
+
}
|
32 |
+
|
33 |
+
}
|
34 |
+
|
35 |
+
?>
|
app/code/community/Expertrec/Recommendation/Model/Catalogsearch/Layer.php
CHANGED
@@ -70,7 +70,7 @@ class Expertrec_Recommendation_Model_Catalogsearch_Layer extends Mage_CatalogSea
|
|
70 |
$this->setExpertrecSearchData();
|
71 |
$product_ids = Mage::helper('expertrec_recommendation/searchhelper')->getResultIds();
|
72 |
Mage::getSingleton('expertrec_recommendation/log')->log(" The expertrec result IDs are ".count($product_ids));
|
73 |
-
|
74 |
$collection
|
75 |
->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
|
76 |
->addFieldToFilter('entity_id',array('in'=>$product_ids))
|
@@ -80,6 +80,20 @@ class Expertrec_Recommendation_Model_Catalogsearch_Layer extends Mage_CatalogSea
|
|
80 |
->addTaxPercents()
|
81 |
->addStoreFilter()
|
82 |
->addUrlRewrite();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
|
84 |
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
|
85 |
Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($collection);
|
70 |
$this->setExpertrecSearchData();
|
71 |
$product_ids = Mage::helper('expertrec_recommendation/searchhelper')->getResultIds();
|
72 |
Mage::getSingleton('expertrec_recommendation/log')->log(" The expertrec result IDs are ".count($product_ids));
|
73 |
+
//Mage::log($product_ids);
|
74 |
$collection
|
75 |
->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
|
76 |
->addFieldToFilter('entity_id',array('in'=>$product_ids))
|
80 |
->addTaxPercents()
|
81 |
->addStoreFilter()
|
82 |
->addUrlRewrite();
|
83 |
+
//->getSelect()->order("find_in_set(e.entity_id, '" . implode(',', $product_ids)."') DESC");
|
84 |
+
$requestParams = Mage::app()->getRequest()->getParams();
|
85 |
+
|
86 |
+
$orderby = isset($requestParams["order"]) ? $requestParams["order"] : 'relevance';
|
87 |
+
$dir = isset($requestParams["dir"]) ? $requestParams["dir"] : 'desc';
|
88 |
+
|
89 |
+
if($orderby == "relevance") {
|
90 |
+
if($dir == 'desc'){
|
91 |
+
$collection->getSelect()->order("find_in_set(e.entity_id, '" . implode(',', $product_ids)."') ASC");
|
92 |
+
}
|
93 |
+
else {
|
94 |
+
$collection->getSelect()->order("find_in_set(e.entity_id, '" . implode(',', $product_ids)."') DESC");
|
95 |
+
}
|
96 |
+
}
|
97 |
|
98 |
Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
|
99 |
Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($collection);
|
app/code/community/Expertrec/Recommendation/controllers/ApiController.php
CHANGED
@@ -19,7 +19,7 @@ class Expertrec_Recommendation_ApiController extends Mage_Core_Controller_Front_
|
|
19 |
const IMAGE_WIDTH = 'expertrec/general/expertrec_image_width';
|
20 |
const IMAGE_HEIGHT = 'expertrec/general/expertrec_image_height';
|
21 |
|
22 |
-
const BUILD_NO = "
|
23 |
private $_password;
|
24 |
|
25 |
// return websites and stores information
|
@@ -554,5 +554,4 @@ class Expertrec_Recommendation_ApiController extends Mage_Core_Controller_Front_
|
|
554 |
return $result;
|
555 |
}
|
556 |
|
557 |
-
}
|
558 |
-
?>
|
19 |
const IMAGE_WIDTH = 'expertrec/general/expertrec_image_width';
|
20 |
const IMAGE_HEIGHT = 'expertrec/general/expertrec_image_height';
|
21 |
|
22 |
+
const BUILD_NO = "1485272396";
|
23 |
private $_password;
|
24 |
|
25 |
// return websites and stores information
|
554 |
return $result;
|
555 |
}
|
556 |
|
557 |
+
}
|
|
app/code/community/Expertrec/Recommendation/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Expertrec_Recommendation>
|
5 |
-
<version>1.1.
|
6 |
</Expertrec_Recommendation>
|
7 |
</modules>
|
8 |
<global>
|
@@ -24,7 +24,12 @@
|
|
24 |
<blocks>
|
25 |
<expertrec_recommendation>
|
26 |
<class>Expertrec_Recommendation_Block</class>
|
27 |
-
</expertrec_recommendation>
|
|
|
|
|
|
|
|
|
|
|
28 |
</blocks>
|
29 |
<resources>
|
30 |
<expertrec_setup>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Expertrec_Recommendation>
|
5 |
+
<version>1.1.2</version>
|
6 |
</Expertrec_Recommendation>
|
7 |
</modules>
|
8 |
<global>
|
24 |
<blocks>
|
25 |
<expertrec_recommendation>
|
26 |
<class>Expertrec_Recommendation_Block</class>
|
27 |
+
</expertrec_recommendation>
|
28 |
+
<catalog>
|
29 |
+
<rewrite>
|
30 |
+
<product_list_toolbar>Expertrec_Recommendation_Block_Product_List_Toolbar</product_list_toolbar>
|
31 |
+
</rewrite>
|
32 |
+
</catalog>
|
33 |
</blocks>
|
34 |
<resources>
|
35 |
<expertrec_setup>
|
package.xml
CHANGED
@@ -1,18 +1,19 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Expertrec_Recommendation</name>
|
4 |
-
<version>1.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>Expertrec
|
10 |
-
<description>
|
|
|
11 |
<notes>Expertrec Recommendation plugin for magento sites.</notes>
|
12 |
<authors><author><name>melchi</name><user>melchi</user><email>magento@cloudinfra.in</email></author><author><name>magento</name><user>magento</user><email>magento-team@cloudinfra.in</email></author></authors>
|
13 |
-
<date>2017-01-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Expertrec"><dir name="Recommendation"><dir name="Helper"><file name="Data.php" hash="41afd664b2087bb1f9361f2630a82bf9"/><file name="Filehelper.php" hash="5ac956e12548398dc159a16eb1a03e8b"/><dir name="Search"><file name="Layout.php" hash="d7b7ec5f4bbd846dd063934f8a267d48"/></dir><file name="Searchhelper.php" hash="791c10fdcb603011004375eeb1cdf498"/><file name="Suggestionhelper.php" hash="93f3aa295761a510f782856c0180a799"/></dir><dir name="Model"><dir name="Api"><file name="Request.php" hash="7df8b22d74b6a05de86da287687a6e96"/></dir><dir name="Catalogsearch"><file name="Layer.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Expertrec_Recommendation</name>
|
4 |
+
<version>1.1.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Expertrec search engine adds instant autocomplete, spell correct, product recommendations and dynamic search results pages to your magento site's search.</summary>
|
10 |
+
<description> Expertrec search extension helps you have complete control over your site search results. You will be able to add instant autocomplete, spell corrections that learn from the user behaviour on your site, and show product recommendations within the search user interface. It also adds search results pages with facets, sorting by different attributes.
|
11 |
+
</description>
|
12 |
<notes>Expertrec Recommendation plugin for magento sites.</notes>
|
13 |
<authors><author><name>melchi</name><user>melchi</user><email>magento@cloudinfra.in</email></author><author><name>magento</name><user>magento</user><email>magento-team@cloudinfra.in</email></author></authors>
|
14 |
+
<date>2017-01-24</date>
|
15 |
+
<time>16:08:37</time>
|
16 |
+
<contents><target name="magecommunity"><dir name="Expertrec"><dir name="Recommendation"><dir name="Block"><dir name="Product"><dir name="List"><file name="Toolbar.php" hash="d4b6d918cfd2779f0d46c1322e7abe0b"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="41afd664b2087bb1f9361f2630a82bf9"/><file name="Filehelper.php" hash="5ac956e12548398dc159a16eb1a03e8b"/><dir name="Search"><file name="Layout.php" hash="d7b7ec5f4bbd846dd063934f8a267d48"/></dir><file name="Searchhelper.php" hash="791c10fdcb603011004375eeb1cdf498"/><file name="Suggestionhelper.php" hash="93f3aa295761a510f782856c0180a799"/></dir><dir name="Model"><dir name="Api"><file name="Request.php" hash="7df8b22d74b6a05de86da287687a6e96"/></dir><dir name="Catalogsearch"><file name="Layer.php" hash="1084f6aa62678d6dc102e094b74892b6"/></dir><dir name="Feed"><file name="Feedconfig.php" hash="013bd447dccc7cc4f073be5bd53a18c9"/><file name="Feedcreator.php" hash="39315afac20326fc7278d1014e0f1142"/><file name="Feedfilter.php" hash="d7599a63a8d1f2033cb1e56204809c2d"/><file name="Formatter.php" hash="e06f27ca673dc58789425ef965467275"/></dir><file name="Feed.php" hash="ddac87d6a060bc77fb7718e7b19e1273"/><file name="Log.php" hash="0d74f297e38bddff9f7c0a3cc86dce8c"/><file name="Observer.php" hash="59b33cf05ec3bf3b349cfef1aea8b84c"/><dir name="Translator"><file name="Category.php" hash="dd209cdda3a1a62042a8a3360ee2dbac"/></dir><file name="Validate.php" hash="7a5fd226b0055e39b725975113e42ee5"/><dir name="Writer"><file name="Abstract.php" hash="53ced825c40d5a6a1d4d35c6de79a68c"/><file name="Csv.php" hash="427fea44d988302f409e1860c18875b1"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="9cf617525636fba1ed4edf6befb5aeea"/></dir><file name="ApiController.php" hash="39fc669fb45b900f420940afab88a780"/><dir name="CatalogSearch"><file name="ResultController.php" hash="9cb1406e901701ea58e663433358a4c6"/></dir><file name="ConfigController.php" hash="0094cf6ffb0410c79d9d5a5a90a31a2d"/><file name="IndexController.php" hash="e8158c90d1b342f4a262e67390bde523"/></dir><dir name="etc"><file name="adminhtml.xml" hash="189a254999463d2ea44669b58c6f0db6"/><file name="config.xml" hash="51861f740f339a8dda415f2e3747ad2b"/></dir><dir name="sql"><dir name="expertrec_setup"><file name="mysql4-install-1.0.0.php" hash="b85230589d57311ab9c8cc335d058770"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Expertrec_Recommendation.xml" hash="c314465f907c89dfe912035be8d48e71"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="expertrec"><file name="recommendation.xml" hash="29d78f020aa26eb5b5d8a2e274e60e4f"/></dir></dir><dir name="template"><dir name="expertrec"><dir name="recommendation"><file name="tracker.phtml" hash="591f8886ce547e817aa9066c85244645"/><dir name="tracking"><file name="product.phtml" hash="71d46668691668e475b9c8f418cf6cbd"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
|
17 |
<compatible/>
|
18 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
|
19 |
</package>
|