Post by scruft » Wed Nov 16, 2011 8:10 am

Hi guys, I'm very new to OC but I'm figuring it out pretty quickly. I've looked everywhere for a mod or extension that will allow the site search to look inside attributes but I can't find anything - is this possible? I sell ink and toner cartridges and have a list of the model(s) of printer that they fit into as an attribute - if a customer searches for their printer model, I'd like the matching cartridges to appear because of the attribute.

I'm running v1.5.1.3 with two stores running (the main/default one is a sandbox, the other one is the one i'm using).

Any help would be awesome. Thanks!

Newbie

Posts

Joined
Wed Nov 16, 2011 8:02 am
Location - Cairns, Qld, Australia

Post by aledmann » Wed Nov 16, 2011 3:20 pm


User avatar
New member

Posts

Joined
Thu Sep 08, 2011 9:56 pm

Post by scruft » Wed Nov 16, 2011 3:29 pm

Thanks for that, my problem is that those extensions all create an "advanced search" type box and the customer needs to select the various options. All I want is for the site search (the existing search box) to look in Attribute fields as well as where it looks now. It seems odd that these days a search function doesn't search the entire site.

Newbie

Posts

Joined
Wed Nov 16, 2011 8:02 am
Location - Cairns, Qld, Australia

Post by Degsey » Mon Dec 26, 2011 12:58 am

I would be interested in this solution as well?

Live Long and Prosper!

Degsey :-]

Visit us at :

http://www.Supreme-Ink.com


User avatar
New member

Posts

Joined
Sun Jun 12, 2011 2:29 am
Location - North Carolina

Post by scruft » Mon Dec 26, 2011 4:46 pm

No solution for this yet :(

Newbie

Posts

Joined
Wed Nov 16, 2011 8:02 am
Location - Cairns, Qld, Australia

Post by prioritypie » Wed May 02, 2012 9:09 am

I've not worked this through that thoroughly, but it seems to work. Tested in 1.5.2.1.

In catalog/model/catalog/product.php find the lines like this:

Code: Select all

    if (!empty($data['filter_category_id'])) {
        $sql .= " LEFT JOIN " . DB_PREFIX . "product_to_category p2c ON (p.product_id = p2c.product_id)";
    }
and insert the following code below it:

Code: Select all

    //Add search in attributes
    $sql .= " LEFT JOIN " . DB_PREFIX . "product_attribute pa ON (p.product_id = pa.product_id)";
Then a few lines down look for:

Code: Select all

    } else {
        $implode[] = "LCASE(pd.name) LIKE '%" . $this->db->escape(utf8_strtolower($word)) . "%'";
    }
And below that add (make sure it goes after the closing brace of the else clause shown above):

Code: Select all

    //Search in attributes
    $implode[] = "LCASE(pa.text) LIKE '%"  . $this->db->escape(utf8_strtolower($word)) . "%'";

Newbie

Posts

Joined
Mon Dec 19, 2011 7:00 pm

Post by nullx8 » Sat Dec 14, 2013 7:35 pm

that does looks like what i need, do you have a 1.5.6 update on the code :)

Newbie

Posts

Joined
Sun Dec 08, 2013 2:46 pm

Post by Johnathan » Sat Dec 14, 2013 10:26 pm

Just to note, Smart Search can search in the attributes (as well as a variety of other data fields).

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by wojtek81 » Fri Jan 24, 2014 9:59 pm

Hi!

I'm also looking for solution of this issue for OC version 1.5.6 - product.php from version 1.5.3 is different from newer versions, and I'm not very strong in PHP :)

Thanks in advance and greetings from Poland - it's cold and snowy here :)
Wojtek

Newbie

Posts

Joined
Fri Jan 24, 2014 9:33 pm
Who is online

Users browsing this forum: Bing [Bot] and 18 guests