# SOLVED: Search all criteria in Complementary attributes

**URL:** <https://www.dolibarr.org/forum/t/solved-search-all-criteria-in-complementary-attributes/16128>\
**Category:** Using my Dolibarr\
**Created:** [November 3, 2017, 10:46pm UTC](https://www.dolibarr.org/forum/t/solved-search-all-criteria-in-complementary-attributes/16128 "2017-11-03T22:46:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Withheld](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/withheld/32/466_2.png) [@Withheld](https://www.dolibarr.org/forum/u/Withheld)\
**Post date:** [November 3, 2017, 10:46pm UTC](https://www.dolibarr.org/forum/t/solved-search-all-criteria-in-complementary-attributes/16128/1 "2017-11-03T22:46:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Withheld](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/withheld/32/466_2.png) [@Withheld](https://www.dolibarr.org/forum/u/Withheld)\
**Post date:** [November 7, 2017, 7:17pm UTC](https://www.dolibarr.org/forum/t/solved-search-all-criteria-in-complementary-attributes/16128/2 "2017-11-07T19:17:56Z")

</div>

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

```auto
// 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.

---

<div class="post-metadata">

**Author:** ![aljawaid](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/aljawaid/32/388_2.png) [@aljawaid](https://www.dolibarr.org/forum/u/aljawaid)\
**Post date:** [November 7, 2017, 8:59pm UTC](https://www.dolibarr.org/forum/t/solved-search-all-criteria-in-complementary-attributes/16128/3 "2017-11-07T20:59:03Z")

</div>

Thank you, that really helped a lot!

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

```auto
// 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

---

<div class="post-metadata">

**Author:** ![Withheld](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/withheld/32/466_2.png) [@Withheld](https://www.dolibarr.org/forum/u/Withheld)\
**Post date:** [November 9, 2017, 10:13am UTC](https://www.dolibarr.org/forum/t/solved-search-all-criteria-in-complementary-attributes/16128/4 "2017-11-09T10:13:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Munchilu](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/munchilu/32/2701_2.png) [@Munchilu](https://www.dolibarr.org/forum/u/Munchilu)\
**Post date:** [March 26, 2020, 5:53am UTC](https://www.dolibarr.org/forum/t/solved-search-all-criteria-in-complementary-attributes/16128/5 "2020-03-26T05:53:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![conrado](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/c/7ea924/32.png) [@conrado](https://www.dolibarr.org/forum/u/conrado)\
**Post date:** [October 28, 2026, 8:29pm UTC](https://www.dolibarr.org/forum/t/solved-search-all-criteria-in-complementary-attributes/16128/6 "2026-10-28T20:29:15Z")

</div>

I’ve found this thread via search in the forum; I have a manufacturer’s part number as “mpn” in extrafields. Can I include extrafields in the search criteria for takepos or new facture search?
