Page 1 of 2

Search Engine search descriptions by default

Posted: Fri May 07, 2010 11:19 am
by zerojinx
I think I may be missing something very simple. I want the search engine to search descriptions by default, but can not find the place to turn this on. I have searched these forums and haven;t found any solutions for the latest version of opencart. I have seen reference to checking search descriptions, but have not found a place to make it search descriptions by default.

any help?

Re: Search Engine search descriptions by default

Posted: Fri May 07, 2010 11:55 am
by Qphoria
1. EDIT: catalog/view/theme/YOURTHEME/template/common/header.tpl

2. FIND:

Code: Select all

location = url;
3. BEFORE ADD:

Code: Select all

url += '&description=1';

Re: Search Engine search descriptions by default

Posted: Fri May 07, 2010 12:57 pm
by zerojinx
that did the trick. thank you so much.

Re: Search Engine search descriptions by default

Posted: Fri May 07, 2010 5:16 pm
by dramony
what about if i use the search module not the search on the header?

Re: Search Engine search descriptions by default

Posted: Sat May 15, 2010 5:33 am
by hiiisociety
Qphoria wrote:1. EDIT: catalog/view/theme/YOURTHEME/template/common/header.tpl

2. FIND:

Code: Select all

location = url;
3. BEFORE ADD:

Code: Select all

url += '&description=1';

Is there a way to enable to "model" as well?

Thanks in advance.

J

Re: Search Engine search descriptions by default

Posted: Sat May 15, 2010 11:25 pm
by Qphoria
before anyone asks a stupid question about how to make it search "model" as well

After, the above, add:

Code: Select all

url += '&model=1';

Re: Search Engine search descriptions by default

Posted: Mon May 17, 2010 4:05 pm
by muslimsg
where to add this exactly........ I am using 1.4.7

plz help
Qphoria wrote:1. EDIT: catalog/view/theme/YOURTHEME/template/common/header.tpl

2. FIND:

Code: Select all

location = url;
3. BEFORE ADD:

Code: Select all

url += '&description=1';

Re: Search Engine search descriptions by default

Posted: Mon Jun 21, 2010 4:43 pm
by rikverhagen
Hi,
Unfornatally there is no 'location = url;' in header.tpl at all at v1.3.3.
What's the trick in here?
Yes I know its an old version ;)
Thanks!

Re: Search Engine search descriptions by default

Posted: Sun Oct 17, 2010 2:42 am
by barnesnet
I think I may have come across a ‘bug’ or glitch. I haven’t actually tried making the above changes yet but am really thinking about it.
I tried out of curiosity making various searches on my site to see what the differences were when choosing the ‘advanced search’ check boxes.

A strange thing occurred when choosing both 'search product description’ and ‘search product model’ at the same time.
The search revealed a hidden (disabled) product I had been using as a product template.

This product does not show under normal searches or indeed when chasing just one of the options above but only when both options are selected at the same time. Also this disabled product does not as far as i can see contain any of the search terms and show under any searches using the above double method.

I am also using the ‘advanced search’ add-on which doesn’t rely on keywords being next to each other.
Just wondering if this is a known problem, if it could be due to the add-on or if others experience it on a clean install?

Re: Search Engine search descriptions by default

Posted: Tue Aug 30, 2011 8:42 pm
by nyltak
what versions does this fix work on? doesn't seem to apply to 1.5.x

Re: Search Engine search descriptions by default

Posted: Fri Sep 02, 2011 12:45 am
by ivex
Qphoria you are a genius!!!....thanks.....works perfectly in 1.4.9.3.

Re: Search Engine search descriptions by default

Posted: Sat Jan 07, 2012 3:10 am
by kylehamilton
In version 1.5.1 it's in the common.js file:

/catalog/view/javascript/common.js

in the first two functions (see comments):

/* Search */
$('.button-search').bind('click', function() {
url = 'index.php?route=product/search';
url += '&filter_description=true'; // add this to search descriptions
url += '&filter_sub_category=true'; // add this to search sub-categories


var filter_name = $('input[name=\'filter_name\']').attr('value')

if (filter_name) {
url += '&filter_name=' + encodeURIComponent(filter_name);
}

location = url;
});

$('#header input[name=\'filter_name\']').keydown(function(e) {
if (e.keyCode == 13) {
url = 'index.php?route=product/search';
url += '&filter_description=true'; // add this to search descriptions
url += '&filter_sub_category=true'; // add this to search sub-categories


var filter_name = $('input[name=\'filter_name\']').attr('value')

if (filter_name) {
url += '&filter_name=' + encodeURIComponent(filter_name);
}

location = url;
}
});

Re: Search Engine search descriptions by default

Posted: Fri Feb 03, 2012 10:48 pm
by aaron1988
Cheers for 1.5 update on search :)

Aaron

Re: Search Engine search descriptions by default

Posted: Fri Mar 02, 2012 6:42 am
by eleven28
Thanks Kyle! Editing common.js works great for me.

Re: Search Engine search descriptions by default

Posted: Mon Mar 05, 2012 10:52 pm
by NTCommerce
Is there any way of altering the common.js file to include the manufacteres name within th search. Ie if I search for gillette all of the products in that manufacturere show up.
Regards
Nigel

Re: Search Engine search descriptions by default

Posted: Fri Mar 16, 2012 10:35 pm
by kylehamilton
You might want to try adding:

&filter_manufacturer=true

to the url (as per above post).

(But I have not tested this).

Re: Search Engine search descriptions by default

Posted: Fri Mar 16, 2012 11:05 pm
by NTCommerce
Thanks Kyle
I had already tried that, it doesn't work. I don't understand the search system well enough to be able to work out where it pulls the info from. It's doing my nut in.
thanks for responding though .
Nigel

Re: Search Engine search descriptions by default

Posted: Mon Mar 19, 2012 1:40 am
by kylehamilton
(weird, I thought I posted a reply a couple of days ago - I guess it got lost in the ether.. :()

Yes, I had a look at it. It won't work. The only reason the other ones worked, was because that functionality was already defined for use on the search results page.

To search by manufacturer you would need to write in that functionality - add it to the sql query and update the php in the model and controller. Not something I can figure out off the top of my head..

Maybe there's a plugin out there that does it?

Re: Search Engine search descriptions by default

Posted: Mon Mar 19, 2012 7:08 pm
by NTCommerce
Hi Kyle , thanks for that, thought it may be a bit more complex. Typical
I have looked for a plugin or mod but to no avail, not sure if I have the skills to sort it but will have to give it a go.
Cheers
Nigel

Re: Search Engine search descriptions by default

Posted: Thu Jun 14, 2012 6:43 am
by kamran85
Hi,

I have tried all options, I have edited the Common.js

but no luck....I am using 1.5.3.1 version