Product list search or list by Description

Hi,
Is there any way to add additional field to list or search the product from product list? Description, I want to add but its not available in the available selection.

Hi Anas,

Adding other fields would require modifying the code.

However searching using the seach box on the left menu (type you keyword, then chose product) will also search in the description (on top of label, reference and note).

Regards,
Marc

Thanks for reply.
However, it does search but doesnt yield the result in description. It will be difficult to figure out which product is exactly required as per description, unless I may search full description.

Modifying code? Do you mean need some programming level work? Any other way??

Well, you are right, you have more options

  1. Create an extrafield that will display the content of the description (it will not be searchable but you can search via the left menu and you will have the description field in your listing if you make it visible on lists)

  2. Modify product/list.php and you will have the description field selectable/searchable/…

  3. Search for an external module on the dolistore. For example, if you are familiar with sql, this module (https://www.dolistore.com/fr/modules/300-myList---listes-dynamiques-personnalis--es.html?search_query=list&results=104) will allow you to get custom lists.

Regards,
Marc

1 Like

Thanks for the reply.
I have tried to edit product/list.php. But I dont see any difference. Well I am not professional at php, but i tried to do my best as what I know.
May be you can help it out?

list.txt (56.0 KB)

list.php.txt (56.0 KB)

Hi Anas,

Congrats, you were almost there. A small mistake in the name of the $arrayfields key. And the enabled value for this key has to be one (the configuration variable you assigned here does not exist…).

Regards,
Marc

1 Like

Thanks a lot Marc, It helped and worked.
But now got another issue. :slight_smile:

I am creating Bill of material, in this also, product is only sorted out with Reference Number (SKU). Is it possible to sort it out (by using additional field or replacing) with description?

Thanks.

Well, that one is more difficult. When you type in, it will actualize a list produced by product/ajax/products.php which in turn calls the function select_produits_list that does the job of searching and providing the right json list. That is where you have to dig if you need to change that list.

On the other hand, if you have lists difficult to search through a select field, you may take profit of the multi-window capabilities of Dolibarr, I mean use the product list window to find your product, then copy/paste the ref in the BOM window.

Regards,
Marc

For now, I am guessing to change Lables in a way that we can decide the nearest description AND using multi window as u said… and later on we may need to fix it once we are up and running well.

Appreciate your support and suggestion Marc.
Thanks a lot.