Post by zerojinx » Fri May 07, 2010 11:19 am

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?

Michael Bielaczyc
http://www.aradanicostumes.com
http://www.aradani.com


New member

Posts

Joined
Fri May 07, 2010 11:17 am

Post by Qphoria » Fri May 07, 2010 11:55 am

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';

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by zerojinx » Fri May 07, 2010 12:57 pm

that did the trick. thank you so much.

Michael Bielaczyc
http://www.aradanicostumes.com
http://www.aradani.com


New member

Posts

Joined
Fri May 07, 2010 11:17 am

Post by dramony » Fri May 07, 2010 5:16 pm

what about if i use the search module not the search on the header?

User avatar
Active Member

Posts

Joined
Sat Oct 24, 2009 12:34 pm

Post by hiiisociety » Sat May 15, 2010 5:33 am

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

http://www.drugcrate.com


New member

Posts

Joined
Tue Apr 13, 2010 4:39 pm

Post by Qphoria » Sat May 15, 2010 11:25 pm

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';

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by muslimsg » Mon May 17, 2010 4:05 pm

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';

New member

Posts

Joined
Thu Sep 17, 2009 8:39 pm

Post by rikverhagen » Mon Jun 21, 2010 4:43 pm

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!

Newbie

Posts

Joined
Sun Nov 29, 2009 10:19 pm

Post by barnesnet » Sun Oct 17, 2010 2:42 am

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?

New member

Posts

Joined
Sat Oct 02, 2010 6:18 am


Post by nyltak » Tue Aug 30, 2011 8:42 pm

what versions does this fix work on? doesn't seem to apply to 1.5.x

New member

Posts

Joined
Wed Jul 20, 2011 9:56 am

Post by ivex » Fri Sep 02, 2011 12:45 am

Qphoria you are a genius!!!....thanks.....works perfectly in 1.4.9.3.

Newbie

Posts

Joined
Sat Mar 12, 2011 7:04 am

Post by kylehamilton » Sat Jan 07, 2012 3:10 am

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;
}
});

Newbie

Posts

Joined
Sat Aug 27, 2011 1:31 am

Post by aaron1988 » Fri Feb 03, 2012 10:48 pm

Cheers for 1.5 update on search :)

Aaron

Active Member

Posts

Joined
Thu Jan 27, 2011 10:03 am

Post by eleven28 » Fri Mar 02, 2012 6:42 am

Thanks Kyle! Editing common.js works great for me.

User avatar
Newbie

Posts

Joined
Fri Jan 27, 2012 6:41 am
Location - Australia

Post by NTCommerce » Mon Mar 05, 2012 10:52 pm

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

New member

Posts

Joined
Tue Jun 14, 2011 7:51 pm

Post by kylehamilton » Fri Mar 16, 2012 10:35 pm

You might want to try adding:

&filter_manufacturer=true

to the url (as per above post).

(But I have not tested this).

Newbie

Posts

Joined
Sat Aug 27, 2011 1:31 am

Post by NTCommerce » Fri Mar 16, 2012 11:05 pm

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

New member

Posts

Joined
Tue Jun 14, 2011 7:51 pm

Post by kylehamilton » Mon Mar 19, 2012 1:40 am

(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?

Newbie

Posts

Joined
Sat Aug 27, 2011 1:31 am

Post by NTCommerce » Mon Mar 19, 2012 7:08 pm

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

New member

Posts

Joined
Tue Jun 14, 2011 7:51 pm

Post by kamran85 » Thu Jun 14, 2012 6:43 am

Hi,

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

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

Newbie

Posts

Joined
Thu Jun 14, 2012 6:39 am
Who is online

Users browsing this forum: No registered users and 37 guests