SOLVED: Search all criteria in Complementary attributes

Hello everyone!

We have about 20 Complementary attributes in the Products and Services module but when searching e.g. C3” @ 4.1# in Products or services, I do not get any results from label “Size NOM. (Inches)” Attribute code “siznomin”.

However, I do a search criteria message, ‘C3” @ 4.1#’ into fields Ref., Ref. supplier, Product label, Description, Note, Bar code.

We have under 5000 products and would like to know, is there is a way to expand search criterial to all Products Complementary attributes?.

To add custom search criteria for Complimentary attributes, locate /htdocs/product/list.php and around line 129 you’ll see

// List of fields to search into when doing a "search in all"
$fieldstosearchall = array(
	'p.ref'=>"Ref",
    'pfp.ref_fourn'=>"RefSupplier",
	'p.label'=>"ProductLabel",
	'p.description'=>"Description",
    "p.note"=>"Note",

Enter your Product’s Complimentary Attributes in the oder you’d like but extactly as shown here ‘YourAttributeCode’=>“Your Label”,

Also, remeber that using wildcards may not work well. Example if searching multiple attribubes like “Primered 4’x8’x1/4” Steel" you should try Primered 4 8 1 4 Steel to narrow searches.

Another thing to remeber, if you upgrade, you may have to update list.php again so keep these in a text file under the products directory.

3 Likes

Thank you, that really helped a lot!

FYI, on my v5.0.4, this is how it looks and works perfectly:

// List of fields to search into when doing a "search in all"
$fieldstosearchall = array(
	'p.ref'=>"Ref",
    'pfp.ref_fourn'=>"RefSupplier",
	'p.label'=>"ProductLabel",
	'p.description'=>"Description",
    "p.note"=>"Note",
    'ef.pricetag'=>"Price Label",
    'ef.bulkbarcode'=>"Bulk Barcode",
);

ef.pricetag = custom field
ef.bulkbarcode = custom field

1 Like

Glad it worked aljawaid! We’re using 6.0.3 and now, our search works as expected with the 20 complimentary attributes.

Just to confirm that it works on 11.x.x and project’s module (list.php is located in “project” folder).