From 0efd118d430ba3c902c570c07bc23a260deaebbe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 26 Oct 2017 16:50:38 +0200 Subject: [PATCH] Fix hook on product list --- htdocs/product/list.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 7fd4135bd4a..0beaab3c9c8 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -426,13 +426,14 @@ else $moreforfilter.=$htmlother->select_categories(Categorie::TYPE_PRODUCT,$search_categ,'search_categ',1); $moreforfilter.=''; } - if ($moreforfilter) + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook + if (empty($reshook)) $moreforfilter.=$hookmanager->resPrint; + else $moreforfilter=$hookmanager->resPrint; + if ($moreforfilter) { print '
'; print $moreforfilter; - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; print '
'; } @@ -788,7 +789,7 @@ else } } // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$objp); $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation