Hello,
J’apporte ma maigre contribution car je cherchais le moyen de faire la même chose
Pour ce faire j’ai ajouté le code suivant, attention je ne suis pas développeur donc ça piquera peut-être aux yeux de certains.
J’ai uniquement modifié le fichier list.php situé dans /htdocs/product
En bleu mes modifications :
Tout d’abord, le titre de colonne, évidemment, il est fixe dans le cas ci-dessous
if (! empty($arrayfields['p.label']['checked'])) print_liste_field_titre($arrayfields['p.label']['label'], $_SERVER["PHP_SELF"],"p.label","",$param,"",$sortfield,$sortorder);
print_liste_field_titre(« Photos »);
if (! empty($arrayfields['p.fk_product_type']['checked'])) print_liste_field_titre($arrayfields['p.fk_product_type']['label'], $_SERVER["PHP_SELF"],"p.fk_product_type","",$param,"",$sortfield,$sortorder);
Ensuite, l’affichage des photos des produits
Vu que j’ai ajouté le titre de la colonne entre « label » et « fk_product_type », je place ma modification au même endroit
J’ai repris les photos contenue dans le répertoire thumb et j’ai tjs pris l’élément 2
// Photos
$dir_product = '/volume1/web/dolibarr_test/documents/produit'; //folder where are the pictures
$subdir_product = $product_static->ref; //product reference
$path_pictures = $dir_product .'/'.$subdir_product.'/thumbs'; //format the path
$files_pictures = scandir($path_pictures); //scan all the file located in the path
$img_product='https://<url of my dolibarr>/htdocs/viewimage.php?modulepart=product&entity=1&file=/'.urlencode($subdir_product).'/thumbs/'.$files_pictures[2]; //the whole path to the picture, change with the url of your dolibarr server
print '<td><img src='.$img_product.'></td>'; //display the picture
Edit : testé sous dolibarr 7 et 8