Version Notes
Searchautocomplete
Download this release
Release Info
Developer | Magento Core Team |
Extension | Searchautocomplete |
Version | 0.0.8 |
Comparing to | |
See all releases |
Code changes from version 0.0.7 to 0.0.8
- app/code/local/Kanavan/Searchautocomplete/Block/Suggest.php +26 -2
- app/code/local/Kanavan/Searchautocomplete/etc/config.xml +1 -1
- app/design/frontend/default/default/template/searchautocomplete/suggest.phtml +1 -0
- app/design/frontend/default/default/template/searchautocomplete/topsearch.phtml +9 -0
- package.xml +4 -4
app/code/local/Kanavan/Searchautocomplete/Block/Suggest.php
CHANGED
@@ -15,8 +15,32 @@ class Kanavan_Searchautocomplete_Block_Suggest extends Mage_Core_Block_Template
|
|
15 |
}
|
16 |
|
17 |
public function getSuggestProducts()
|
18 |
-
{
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
|
22 |
if(Mage::getStoreConfig('searchautocomplete/preview/number_product'))
|
15 |
}
|
16 |
|
17 |
public function getSuggestProducts()
|
18 |
+
{
|
19 |
+
|
20 |
+
|
21 |
+
$query = Mage::helper('catalogsearch')->getQuery();
|
22 |
+
$query->setStoreId(Mage::app()->getStore()->getId());
|
23 |
+
|
24 |
+
if ($query->getRedirect()){
|
25 |
+
$query->save();
|
26 |
+
}
|
27 |
+
else {
|
28 |
+
$query->prepare();
|
29 |
+
}
|
30 |
+
Mage::helper('catalogsearch')->checkNotes();
|
31 |
+
|
32 |
+
|
33 |
+
$versions = Mage::getVersion();
|
34 |
+
if (version_compare($versions, '1.6.0.0', '<'))
|
35 |
+
$results=$query->getResultCollection();//->setPageSize(5);
|
36 |
+
else
|
37 |
+
$results=$query->getSearchCollection();//->setPageSize(5);
|
38 |
+
|
39 |
+
|
40 |
+
|
41 |
+
// $results=Mage::getResourceModel('catalogsearch/search_collection')->addSearchFilter(Mage::app()->getRequest()->getParam('q'));
|
42 |
+
|
43 |
+
// $results->addAttributeToFilter('visibility', array('neq' => 1));
|
44 |
|
45 |
|
46 |
if(Mage::getStoreConfig('searchautocomplete/preview/number_product'))
|
app/code/local/Kanavan/Searchautocomplete/etc/config.xml
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
<config>
|
11 |
<modules>
|
12 |
<Kanavan_Searchautocomplete>
|
13 |
-
<version>0.0.
|
14 |
</Kanavan_Searchautocomplete>
|
15 |
</modules>
|
16 |
<frontend>
|
10 |
<config>
|
11 |
<modules>
|
12 |
<Kanavan_Searchautocomplete>
|
13 |
+
<version>0.0.8</version>
|
14 |
</Kanavan_Searchautocomplete>
|
15 |
</modules>
|
16 |
<frontend>
|
app/design/frontend/default/default/template/searchautocomplete/suggest.phtml
CHANGED
@@ -9,6 +9,7 @@ foreach($suggests as $_suggest)
|
|
9 |
{
|
10 |
echo "<li class=\"suggest\" >{$_suggest->getQueryText()} <span class=\"amount\">{$_suggest->getNumResults()}</span></li>";
|
11 |
}
|
|
|
12 |
if($results->count()&&$this->enabledPreview())
|
13 |
foreach($results as $_pro)
|
14 |
{
|
9 |
{
|
10 |
echo "<li class=\"suggest\" >{$_suggest->getQueryText()} <span class=\"amount\">{$_suggest->getNumResults()}</span></li>";
|
11 |
}
|
12 |
+
|
13 |
if($results->count()&&$this->enabledPreview())
|
14 |
foreach($results as $_pro)
|
15 |
{
|
app/design/frontend/default/default/template/searchautocomplete/topsearch.phtml
CHANGED
@@ -4,11 +4,20 @@
|
|
4 |
<input id="search" type="text" name="<?php echo $this->helper('catalogsearch')->getQueryParamName() ?>" value="<?php echo $this->helper('catalogsearch')->getEscapedQueryText() ?>" class="input-text" />
|
5 |
<button type="submit" title="<?php echo $this->__('Search') ?>" class="button"><span><span><?php echo $this->__('Search') ?></span></span></button>
|
6 |
<div id="search_autocomplete" class="search-autocomplete"></div>
|
|
|
7 |
<script type="text/javascript">
|
8 |
//<![CDATA[
|
9 |
var searchForm = new Varien.searchForm('search_mini_form', 'search', '<?php echo $this->__('Search entire store here...') ?>');
|
10 |
searchForm.initAutocomplete('<?php echo $this->helper('searchautocomplete')->getSuggestUrl() ?>', 'search_autocomplete');
|
11 |
//]]>
|
12 |
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
</div>
|
14 |
</form>
|
4 |
<input id="search" type="text" name="<?php echo $this->helper('catalogsearch')->getQueryParamName() ?>" value="<?php echo $this->helper('catalogsearch')->getEscapedQueryText() ?>" class="input-text" />
|
5 |
<button type="submit" title="<?php echo $this->__('Search') ?>" class="button"><span><span><?php echo $this->__('Search') ?></span></span></button>
|
6 |
<div id="search_autocomplete" class="search-autocomplete"></div>
|
7 |
+
<!--
|
8 |
<script type="text/javascript">
|
9 |
//<![CDATA[
|
10 |
var searchForm = new Varien.searchForm('search_mini_form', 'search', '<?php echo $this->__('Search entire store here...') ?>');
|
11 |
searchForm.initAutocomplete('<?php echo $this->helper('searchautocomplete')->getSuggestUrl() ?>', 'search_autocomplete');
|
12 |
//]]>
|
13 |
</script>
|
14 |
+
-->
|
15 |
+
<script type="text/javascript">
|
16 |
+
//<![CDATA[
|
17 |
+
var searchForm = new Varien.searchForm('search_mini_form', 'search', '<?php echo $this->__('Search entire store here...') ?>');
|
18 |
+
searchForm.initAutocomplete('<?php echo $this->helper('searchautocomplete')->getSuggestUrl() ?>', 'search_autocomplete');
|
19 |
+
//]]>
|
20 |
+
</script>
|
21 |
+
|
22 |
</div>
|
23 |
</form>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Searchautocomplete</name>
|
4 |
-
<version>0.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
@@ -10,9 +10,9 @@
|
|
10 |
<description>Search auto complete support resuft preview. Change result style on backend.</description>
|
11 |
<notes>Searchautocomplete</notes>
|
12 |
<authors><author><name>Kanavan</name><user>auto-converted</user><email>sang@kanavan.net</email></author></authors>
|
13 |
-
<date>2012-03
|
14 |
-
<time>
|
15 |
-
<contents><target name="magelocal"><dir name="Kanavan"><dir name="Searchautocomplete"><dir name="Block"><file name="Ajaxsearch.php" hash="5047292020c9583014428b67496e28a7"/><file name="Suggest.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><package><name>Searchautocomplete</name><channel>community</channel><min>0.0.1</min><max>5.0.0</max></package></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Searchautocomplete</name>
|
4 |
+
<version>0.0.8</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
10 |
<description>Search auto complete support resuft preview. Change result style on backend.</description>
|
11 |
<notes>Searchautocomplete</notes>
|
12 |
<authors><author><name>Kanavan</name><user>auto-converted</user><email>sang@kanavan.net</email></author></authors>
|
13 |
+
<date>2012-05-03</date>
|
14 |
+
<time>03:08:04</time>
|
15 |
+
<contents><target name="magelocal"><dir name="Kanavan"><dir name="Searchautocomplete"><dir name="Block"><file name="Ajaxsearch.php" hash="5047292020c9583014428b67496e28a7"/><file name="Suggest.php" hash="45f2964ddb9a7bfd778bf2f4497a7326"/></dir><dir name="Helper"><file name="Data.php" hash="e1a72f5f0a5b2b50418861215e93315e"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Ajaxsearch"><file name="Collection.php" hash="1fc0d4a1385e74b28865eff2ca1e3e94"/></dir><file name="Ajaxsearch.php" hash="ea71560960a3ca6aa4f24ffb274de741"/></dir><dir name="Source"><file name="Effect.php" hash="0a9dbd10ed43d47099f9ceb00d20978b"/></dir><file name="Ajaxsearch.php" hash="476d278e22ca5d42c4eb564afff09b54"/><file name="Status.php" hash="ff2537ea38d78b9343ba7970cd3c8d3b"/></dir><dir name="controllers"><file name="SuggestController.php" hash="1807b4240cdd403a194d940d1266b763"/></dir><dir name="etc"><file name="config.xml" hash="6bb0c3e06818a55e4890d83d7931a91e"/><file name="system.xml" hash="56bd22feb456e5acede1c01c728203cb"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Kanavan_Searchautocomplete.xml" hash="b307375dc2c1b410fdaad5c845729dd1"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="searchautocomplete.xml" hash="675c8528d4023c0f4752cb11b859fc41"/></dir><dir name="template"><dir name="searchautocomplete"><file name="blank.phtml" hash="7949696b79643341359508a6d6d64921"/><file name="suggest.phtml" hash="b116991dfbb889a4950a24056758dce3"/><file name="topsearch.phtml" hash="cf7af2fafc49c79cb32f03be0b86ca60"/></dir></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><package><name>Searchautocomplete</name><channel>community</channel><min>0.0.1</min><max>5.0.0</max></package></required></dependencies>
|
18 |
</package>
|