# Is it possible to get the "product description" to show up either in the product search or in the hover menu?

**URL:** <https://www.dolibarr.org/forum/t/is-it-possible-to-get-the-product-description-to-show-up-either-in-the-product-search-or-in-the-hover-menu/24398>\
**Category:** PM modules\
**Tags:** v17\
**Created:** [October 8, 2023, 3:43pm UTC](https://www.dolibarr.org/forum/t/is-it-possible-to-get-the-product-description-to-show-up-either-in-the-product-search-or-in-the-hover-menu/24398 "2023-10-08T15:43:53Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![gurksallad](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/g/9d8465/32.png) [@gurksallad](https://www.dolibarr.org/forum/u/gurksallad)\
**Post date:** [October 8, 2023, 3:43pm UTC](https://www.dolibarr.org/forum/t/is-it-possible-to-get-the-product-description-to-show-up-either-in-the-product-search-or-in-the-hover-menu/24398/1 "2023-10-08T15:43:53Z")

</div>

We have a lot of products with similiar properties. We write these properties in the description of the product, so we know which is what.

However, when we perform a search of one of the properties and get a list of matching products, we cannot immediately see which one is which, unless we go into the Product card and read.

Is there anyway to make the full product description show in the popup window, so we don’t have to go into the Product card for all the products? Or make description show up in the table? (That column is not selectable for some reason)

See screendump. It shows label, ref and price, we want “description” here too.

 ![2023-10-08_174005](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/a/a4870eaa3af7244934c10c01306eabf97e3c02a8.png)

---

<div class="post-metadata">

**Author:** ![DG-Rilling](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@DG-Rilling](https://www.dolibarr.org/forum/u/DG-Rilling)\
**Post date:** [October 9, 2023, 10:04am UTC](https://www.dolibarr.org/forum/t/is-it-possible-to-get-the-product-description-to-show-up-either-in-the-product-search-or-in-the-hover-menu/24398/2 "2023-10-09T10:04:10Z")

</div>

Yes,  
you have to modify 2 files.

1.) search in ~/htdocs/product/list.php for the following

```auto
$sql = 'SELECT p.rowid, p.ref, p.label, p.fk_product_type, p.barcode, p.price, p.tva_tx, p.price_ttc, p.price_base_type, p.entity,';

```

and add “p.description” to the query. Now it looks like the following

```auto
$sql = 'SELECT p.rowid, p.ref, p.description, p.label, p.fk_product_type, p.barcode, p.price, p.tva_tx, p.price_ttc, p.price_base_type, p.entity,';

```

Next search for (same file)

```auto
	if (empty($reshook)) {
		$product_static->id = $obj->rowid;
		$product_static->ref = $obj->ref;
		$product_static->ref_fourn = empty($obj->ref_supplier) ? '' : $obj->ref_supplier; // deprecated

```

and add “$product\_static-\>description = $obj-\>description;”. Now it looks like the following

```auto
	if (empty($reshook)) {
		$product_static->id = $obj->rowid;
		$product_static->ref = $obj->ref;
		$product_static->description = $obj->description;
		$product_static->ref_fourn = empty($obj->ref_supplier) ? '' : $obj->ref_supplier; // deprecated

```

2.) add in ~/htdocs/product/class/product.class.php  
in public function getNomUrl(…)

```auto
		if (!empty($this->description)) {
			$label .= '<br><b>'.$langs->trans('ProductDescription').':</b> '.$this->description;
		}

```

after the line

```auto
		if (!empty($this->label)) {
			$label .= '<br><b>'.$langs->trans('ProductLabel').':</b> '.$this->label;
		}

```

This shows the description of the product when you hover the ref of the product in the list view.

---

<div class="post-metadata">

**Author:** ![sonikf](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@sonikf](https://www.dolibarr.org/forum/u/sonikf)\
**Post date:** [October 9, 2023, 8:26pm UTC](https://www.dolibarr.org/forum/t/is-it-possible-to-get-the-product-description-to-show-up-either-in-the-product-search-or-in-the-hover-menu/24398/3 "2023-10-09T20:26:14Z")

</div>

HI @DG-Rilling  
Could you please make a pr for that, it is very useful!

---

<div class="post-metadata">

**Author:** ![DG-Rilling](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@DG-Rilling](https://www.dolibarr.org/forum/u/DG-Rilling)\
**Post date:** [October 12, 2023, 9:19am UTC](https://www.dolibarr.org/forum/t/is-it-possible-to-get-the-product-description-to-show-up-either-in-the-product-search-or-in-the-hover-menu/24398/4 "2023-10-12T09:19:18Z")

</div>

In version 18 the second change must be modified as follows:  
2.) add in ~/htdocs/product/class/product.class.php  
in

> public function getTooltipContentArray($params)  
> …

```auto
		if (!empty($this->description)) {
			$datas['description']= '<br><b>'.$langs->trans('ProductDescription').':</b> '.$this->description;
		}

```

after the line

```auto
		if (!empty($this->label)) {
			$datas['label']= '<br><b>'.$langs->trans('ProductLabel').':</b> '.$this->label;
		}

```

@sonikf  
I hope that I have created the pr correctly. Is my first pr :wink:

---

<div class="post-metadata">

**Author:** ![mgribaudo](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/mgribaudo/32/3096_2.png) [@mgribaudo](https://www.dolibarr.org/forum/u/mgribaudo)\
**Post date:** [October 18, 2023, 8:41am UTC](https://www.dolibarr.org/forum/t/is-it-possible-to-get-the-product-description-to-show-up-either-in-the-product-search-or-in-the-hover-menu/24398/5 "2023-10-18T08:41:30Z")

</div>

Hi,  
changing the code of Dolibarr modules is never a good idea, at the next update you will lose the changes.  
Try to see if you can do the same thing with a [hook](https://wiki.dolibarr.org/index.php?title=Hooks_system).

---

<div class="post-metadata">

**Author:** ![sonikf](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@sonikf](https://www.dolibarr.org/forum/u/sonikf)\
**Post date:** [October 18, 2023, 7:12pm UTC](https://www.dolibarr.org/forum/t/is-it-possible-to-get-the-product-description-to-show-up-either-in-the-product-search-or-in-the-hover-menu/24398/6 "2023-10-18T19:12:48Z")

</div>

Hi @ksar,  
Please mark @DG-Rilling answer as the solution.  
His related commit was merged [Show product description by tgsw · Pull Request #26193 · Dolibarr/dolibarr · GitHub](https://github.com/Dolibarr/dolibarr/pull/26193)

---

<div class="post-metadata">

**Author:** ![gurksallad](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/g/9d8465/32.png) [@gurksallad](https://www.dolibarr.org/forum/u/gurksallad)\
**Post date:** [October 19, 2023, 4:26pm UTC](https://www.dolibarr.org/forum/t/is-it-possible-to-get-the-product-description-to-show-up-either-in-the-product-search-or-in-the-hover-menu/24398/7 "2023-10-19T16:26:42Z")

</div>

I made a quick-hack by patching the code to show the Description field as well, and I must say it should definately be implemented (for real, and not using my quick-hack which will be gone in next upgrade). It’s very useful and looks like this in our setup:

 ![2023-10-19_182043](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/8/85b9f4b8b166da8f03a95ffa5a4613983ddb7184.png)

The suggestion is in ticket #26142 on github: [Make product description available as a column · Issue #26142 · Dolibarr/dolibarr · GitHub](https://github.com/Dolibarr/dolibarr/issues/26142) and I hope someone can implement it.

---

<div class="post-metadata">

**Author:** ![ksar](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/ksar/32/514_2.png) [@ksar](https://www.dolibarr.org/forum/u/ksar)\
**Post date:** [October 19, 2023, 7:25pm UTC](https://www.dolibarr.org/forum/t/is-it-possible-to-get-the-product-description-to-show-up-either-in-the-product-search-or-in-the-hover-menu/24398/8 "2023-10-19T19:25:02Z")

</div>

Hello,

> [@gurksallad](#):
>
> I hope someone can implement it.

Why do you not push to a Pull Request in GitHub ?

Even if it’s your first one, it’s quite easy to do, and you seem familiar with GitHub !

---

<div class="post-metadata">

**Author:** ![gurksallad](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/g/9d8465/32.png) [@gurksallad](https://www.dolibarr.org/forum/u/gurksallad)\
**Post date:** [October 20, 2023, 4:25am UTC](https://www.dolibarr.org/forum/t/is-it-possible-to-get-the-product-description-to-show-up-either-in-the-product-search-or-in-the-hover-menu/24398/9 "2023-10-20T04:25:51Z")

</div>

@ksar I use git and github for my own project, but it’s over my head how to make PR for projects I’m not a collaborator on. So I guess I simply will have to read up on how to do something like that.

---

<div class="post-metadata">

**Author:** ![priojk](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/priojk/32/6121_2.png) [@priojk](https://www.dolibarr.org/forum/u/priojk)\
**Post date:** [October 20, 2023, 6:22am UTC](https://www.dolibarr.org/forum/t/is-it-possible-to-get-the-product-description-to-show-up-either-in-the-product-search-or-in-the-hover-menu/24398/10 "2023-10-20T06:22:30Z")

</div>

I think, this feature has just been merged into develop, as also @sonikf mentioned in an earlier message:

> <https://github.com/Dolibarr/dolibarr/pull/26193>
>
> \# NEW shows the product-description when hover product-ref in the list view of p…roducts
> shows the product-description (only if not empty) when hover product-ref in the list view of products

---

<div class="post-metadata">

**Author:** ![gurksallad](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/g/9d8465/32.png) [@gurksallad](https://www.dolibarr.org/forum/u/gurksallad)\
**Post date:** [October 20, 2023, 7:17am UTC](https://www.dolibarr.org/forum/t/is-it-possible-to-get-the-product-description-to-show-up-either-in-the-product-search-or-in-the-hover-menu/24398/11 "2023-10-20T07:17:17Z")

</div>

Yes, the “hover to show description” is being merged but I’m talking about “Enabling the Description column in Product list”. Github issue #26142.

---

<div class="post-metadata">

**Author:** ![altatof](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/altatof/32/2426_2.png) [@altatof](https://www.dolibarr.org/forum/u/altatof)\
**Post date:** [October 22, 2023, 7:25am UTC](https://www.dolibarr.org/forum/t/is-it-possible-to-get-the-product-description-to-show-up-either-in-the-product-search-or-in-the-hover-menu/24398/12 "2023-10-22T07:25:18Z")

</div>

Hello, it seems to be already don on the develop branch (line 227 here [https://github.com/Dolibarr/dolibarr/blob/develop/htdocs/product/list.php](https://github.com/Dolibarr/dolibarr/blob/develop/htdocs/product/list.php)).  
With that the description column is available in the columns list choice.

---

<div class="post-metadata">

**Author:** ![gurksallad](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/g/9d8465/32.png) [@gurksallad](https://www.dolibarr.org/forum/u/gurksallad)\
**Post date:** [October 22, 2023, 7:40am UTC](https://www.dolibarr.org/forum/t/is-it-possible-to-get-the-product-description-to-show-up-either-in-the-product-search-or-in-the-hover-menu/24398/13 "2023-10-22T07:40:48Z")

</div>

@altatof It exists because I created it two days ago, after @ksar suggested me to make a PR myself.

See [Update list.php by bos4711 · Pull Request #26287 · Dolibarr/dolibarr · GitHub](https://github.com/Dolibarr/dolibarr/pull/26287)
