cilo Posted January 27, 2011 Share Posted January 27, 2011 I figured out how to change the Search.php class to be able to search in FO by supplier reference, but i am not able to do the same with supplier reference of product combinations.Is there a solution for this? I searched the forum...unsuccesfullThanks Link to comment Share on other sites More sharing options...
smiffy Posted February 1, 2011 Share Posted February 1, 2011 Okay, a product has a supplier......I fail to understand how the presence, or absence, of attributes(ummm, you wrote 'combinations'. Combinations, as in, 'packs'?)would cause a product to become unsearchable.Using the sample database, I just tested this:add new product, titled 'supergood'it is a PACKitem1 is an ipoditem2 is a MacbookAirsupplier is SHUREprice is 20goto frontend, use the native searchbox, type 'shure'and 'supergood' is among the products returned in the search resultsI edited the product, added features and created a 'Combination' for the product, savedand again searched the frontend.Still, no problem. Same (expected) result. Link to comment Share on other sites More sharing options...
cilo Posted February 1, 2011 Author Share Posted February 1, 2011 The product has a supplier, but also has a "supplier reference"...it is the unique identifier of the product.If I have a product named PRODUCT1 available in black, white, green, my supplier has a unique identifier of the three colours(product supplier reference).I just vant to search by these unique IDs. Link to comment Share on other sites More sharing options...
danshaffer Posted March 21, 2011 Share Posted March 21, 2011 I'm trying to do same thing, but on back end as well.Similar scenario, say there are two items, a green one and red one. My and supplier reference is GOSU-R and GOSU-G, customer called on the phone and says they have a question about partnumber GOSU-R because they want to get a deal on 100 of them. Right now I have a excel sheet with all the Part numbers so will put me in the right ballpark for what they are talking about.Be nice to seach backend, so can get an idea what I'm paying for them, see pic and all that. Link to comment Share on other sites More sharing options...
markb Posted April 22, 2011 Share Posted April 22, 2011 I figured out how to change the Search.php class to be able to search in FO by supplier reference, but i am not able to do the same with supplier reference of product combinations.Is there a solution for this? I searched the forum...unsuccesfullThanks Can you tell me, how did you manage to add search by supplier_reference?Answering myself:Hi I managed to get search by supplier_reference sorted (Prestashop 1.3.1).For anyone else:add below (around line 311)reference' => Configuration::get('PS_SEARCH_WEIGHT_REF'),'supplier_reference' => 10,change line 324 toSELECT p.id_product, pl.id_lang, pl.name as pname, p.reference, p.supplier_reference, p.ean13, pl.description_short, pl.description, cl.name as cname, m.name as mname Link to comment Share on other sites More sharing options...
markb Posted June 22, 2012 Share Posted June 22, 2012 (edited) To search by supplier reference: it occurs to me that one easy way to get the attribute product references to be searchable would be to create a new Feature called something like "related product references" for each product with attributes and then list the attribute references e.g. ref 123456, ref 234567, ref 567890 etc.. As features are searchable this should work. If you wish to use a more pure solution, then you will need to create an override of the Search.php class. To do this create a file something like (depending on the version of PS you are using, below is for PS 1.4.6.2). <?php class Search extends SearchCore { public static function getAttributes($db, $id_product, $id_lang) { $attributes = ''; $attributesArray = $db->ExecuteS(' SELECT al.name FROM '._DB_PREFIX_.'product_attribute pa INNER JOIN '._DB_PREFIX_.'product_attribute_combination pac ON pa.id_product_attribute = pac.id_product_attribute INNER JOIN '._DB_PREFIX_.'attribute_lang al ON (pac.id_attribute = al.id_attribute AND al.id_lang = '.(int)$id_lang.') WHERE pa.id_product = '.(int)$id_product); foreach ($attributesArray AS $attribute) $attributes .= $attribute['name'].' '; $AdditionalAttributesArray = $db->ExecuteS(' SELECT supplier_reference FROM '._DB_PREFIX_.'product_attribute WHERE id_product = '.(int)$id_product); foreach ($AdditionalAttributesArray AS $attribute) $attributes .= $attribute['supplier_reference'].' '; return $attributes; } } call it Search.php and save it in your overrides/classes folder. Then update your index by going to Back Office > Preferences > Search and rebuild entire index. Edited June 22, 2012 by markb (see edit history) Link to comment Share on other sites More sharing options...
EVDPOL Posted March 10, 2014 Share Posted March 10, 2014 it doesn't work... or am i doing something wrong? its for prestashop 1.5.6.2 Link to comment Share on other sites More sharing options...
newcomer Posted March 3, 2016 Share Posted March 3, 2016 Need this badly too. Any love for 1.6? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now