Page 1 of 1
Improved search feature
Posted: Fri Jun 17, 2011 5:44 pm
by QenTox
I hope, I am not the only one, but there are some products, that have more than one common name. But you can not list all of them in the product name. Would be great to add a field, where you can actually enter all the other options as well. One example:
There is a game called Called of Duty 4: Modern Warfare
People are often searching for the game by typing only COD 4 or COD 4 MW. So would be really great and helpful to actually add somewhere in the admin area extra field, where you can list all the other common names for the products. Hopefully someone will at least read this and aprreciate it :-)
Re: Improved search feature
Posted: Fri Jun 17, 2011 5:52 pm
by rph
The easiest way to do that without any modding is to add those terms to product tags.
Re: Improved search feature
Posted: Fri Jun 17, 2011 6:01 pm
by QenTox
I was adding them to key words, but that way it wasn't working, will do it, thanks a lot rph for your help, hope it will work :-)
Re: Improved search feature
Posted: Sun Jun 19, 2011 4:37 am
by QenTox
Not working, if I add them to tags :-( Actually I am using ajax mod for search, so you only have to put the first few characters in the search field, and then it gives you suggestions of all available products...
Re: Improved search feature
Posted: Sun Jun 19, 2011 9:37 am
by Xsecrets
QenTox wrote:Not working, if I add them to tags :-( Actually I am using ajax mod for search, so you only have to put the first few characters in the search field, and then it gives you suggestions of all available products...
well then go talk to the person that wrote the ajax mod, because the default opencart search does search tags.
Re: Improved search feature
Posted: Sun Jun 19, 2011 6:10 pm
by funrider
Xsecrets wrote:QenTox wrote:Not working, if I add them to tags :-( Actually I am using ajax mod for search, so you only have to put the first few characters in the search field, and then it gives you suggestions of all available products...
well then go talk to the person that wrote the ajax mod, because the default opencart search does search tags.
Indeed the advanced search can do that. However I think that the main search bar on the homepage should also search in text and tags besides the title instead of finding nothing and then go to advanced and tick off such options and then find the products. I already adjusted in my website but i think that should be standard in the main search bar feature.
Re: Improved search feature
Posted: Mon Jun 27, 2011 10:30 pm
by funrider
I received a request on this search feature in my PM so i thought i would post it here too. Credits are for someone else. I did find this in the forum somewhere a while ago.
This is the code as I'm using it in the catalog/view/theme/themename/template/common/header.tpl
Code: Select all
<div id="search">
<div class="div9">
<select id="filter_category_id">
<option value="0"><?php echo $text_category; ?></option>
<?php foreach ($categories as $category) { ?>
<?php if ($category['category_id'] == $category_id) { ?>
<option value="<?php echo $category['category_id']; ?>" selected="selected"><?php echo $category['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $category['category_id']; ?>"><?php echo $category['name']; ?></option>
<?php } ?>
<?php } ?>
</select>
<?php if ($keyword) { ?>
<input type="text" value="<?php echo $keyword; ?>" id="filter_keyword" />
<?php } else { ?>
<input type="text" value="<?php echo $text_keyword; ?>" id="filter_keyword" onclick="this.value = '';" onkeydown="this.style.color = '#000000'" style="color: #999;" />
<?php } ?>
<div class="div10"><a onclick="moduleSearch();" class="search_button"><?php echo $button_go; ?></a></div>
</div>
</div>
Another think you could do is change the advanced search page and always have all boxes ticked there.
The location of that is:
catalog/view/theme/themename/template/product/search.tpl
The changes in the code should be these two below and have them set on 'checked'
Code: Select all
id="description" checked="checked"
id="model" checked="checked"
Re: Improved search feature
Posted: Mon Jun 27, 2011 10:36 pm
by Xsecrets
funrider wrote:Xsecrets wrote:QenTox wrote:Not working, if I add them to tags :-( Actually I am using ajax mod for search, so you only have to put the first few characters in the search field, and then it gives you suggestions of all available products...
well then go talk to the person that wrote the ajax mod, because the default opencart search does search tags.
Indeed the advanced search can do that. However I think that the main search bar on the homepage should also search in text and tags besides the title instead of finding nothing and then go to advanced and tick off such options and then find the products. I already adjusted in my website but i think that should be standard in the main search bar feature.
You don't have to go to the advanced search to search in tags. There is no option on the advanced search page to search in tags. I think you are confusing it with model and description.
Re: Improved search feature
Posted: Thu Jun 30, 2011 6:27 pm
by uksitebuilder
-removed-
Re: Improved search feature
Posted: Fri Jul 01, 2011 5:00 pm
by jarredrame
Im not 100% on this, but I do like the concept.
There are certainly a couple more details to take into consideration, But Good!
easy scholarship
Finding scholarships
Re: Improved search feature
Posted: Fri Jul 01, 2011 9:53 pm
by wonderland
Thank you, thank you, thank you !
I'm so happy now that search works so much better ! It's great that you shared
It works good, but sometimes I get no results when searching "productname" but If I search "Brandname + productname" I get correct results.
Also I noticed that sometimes if I search for "Brandname + productname" I get "Wrongbrandname + productname"
Are there any suggestion on how to improve this a bit further.
I tag my propucts like this - Brandname, productcategory (which is usually part of productname)
Re: Improved search feature
Posted: Fri Jul 01, 2011 10:51 pm
by uksitebuilder
Hi,
Could you PM me some examples and a link t you site so I can see what is happening, or not as the case may be.
Re: Improved search feature
Posted: Fri Jul 01, 2011 10:54 pm
by uksitebuilder
jarredrame wrote:Im not 100% on this, but I do like the concept.
There are certainly a couple more details to take into consideration, But Good!

This was just a quick initial fix.
Certainly more can be done to expand the options for breaking down the search on the advanced search page.
I will also look into quitting the loop early if an exact match or matches are found for the whole search term.
Re: Improved search feature
Posted: Sat Jul 02, 2011 12:57 am
by uksitebuilder
Updated my script above to solve problems when searching for terms containing diacritics (e.g. šķīdinātājs)
Re: Improved search feature
Posted: Sat Jul 02, 2011 2:07 am
by uksitebuilder
One more update to the script above.
If the whole search term is found, the searching is quit and the results are returned for those matches.
If not then the search term is split in to single words and each word is searched for and all the results are shown.
This should help stop too many results being shown if a product or products exist that match the whole search term.