How to search in more fields (third party search)

Hi,

I use the search bar a lot, and I would specifically like the search to also search the fields of phone number and place (address) - this would be really helpful.
I have the impression that that is adjustable, but I just do not know how or where in the settings I can do this.

Now the search is limited to company name, customer number, VAT number, professional ID;s and so I would like to add phone number and place to that search list.
How can I do this.

thank you.

Hi,

Could someone please look into this? Thank you!

To expand the Third Party search to include phone numbers, you’ll need to edit /htdocs/societe/list.php

Around line 128 you’ll find

's.email'=>"EMail",

After that line add this line exactly as shown.

's.phone'=>"Phone",

To expand the Contacts search to include phone numbers, you’ll need to edit /htdocs/contact/list.php

Around 131 you’ll find

'p.email'=>'EMail',
After that line add this line exactly as shown.

'p.phone'=>'Phone',

Now. Because wildcards ( ) # - etc. affect searches, you’ll have to play around (start with the last 4 digits) until you find a way to find works

You can improve other searches as well including Complimentary attributes with other modules too. Just find the list.php that you wish to modify.

And lastly, if you upgrade Dolibarr, you’ll need to re-enter these modifications so keep them somewhere you’ll remember them like list.txt in their respective folders.

1 Like

This worked perfect! thank you

Hi,
I’m facing quite similar issue.
I’ve found another way to do that, without changing the php code, so I share it here
V15.0.1

Add a global Fields from admin panel
name=
PRODUCT_QUICKSEARCH_ON_FIELDS

value =
p.ref=Ref;p.label=Productlabel;pfp.ref_fourn=RefSupplier;p.description=Description;p.note=Note;ef.reffrabricant=RefFabricant;ef.nomfabricant=NomFabricant

Here, you need to add all the fields you want to search in because it will overwrite all the default ‘search in’ fields.
If you dont know the name of each field, add all the relevant fields to your product list and then press on a field to make a sorting. Then look at the url what is after sortfield. Example:
http://localhost/dolibarr/product/list.php?sortfield=ef.nomfabricant

here, ef.nomfabricant is one of my custom extra fields (manufacturer name).

Julien