From e1baf3ab2be05ec7667a3f356d6d8bfa7329cee3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 14 Dec 2018 10:01:12 +0100 Subject: [PATCH] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 721c1997086..77b36354f15 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2017,12 +2017,15 @@ class Form $sql = "SELECT "; $sql.= $selectFields . $selectFieldsGrouped; - //Product category - $sql.= ", (SELECT ".MAIN_DB_PREFIX."categorie_product.fk_categorie - FROM ".MAIN_DB_PREFIX."categorie_product - WHERE ".MAIN_DB_PREFIX."categorie_product.fk_product=p.rowid - LIMIT 1 + if (! empty($conf->global->PRODUCT_SORT_BY_CATEGORY)) + { + //Product category + $sql.= ", (SELECT ".MAIN_DB_PREFIX."categorie_product.fk_categorie + FROM ".MAIN_DB_PREFIX."categorie_product + WHERE ".MAIN_DB_PREFIX."categorie_product.fk_product=p.rowid + LIMIT 1 ) AS categorie_product_id "; + } //Price by customer if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid))