From ad942afbf1ea47f4af02bd29e0ce4007a7f251a8 Mon Sep 17 00:00:00 2001 From: fmarcet Date: Wed, 16 Mar 2016 16:30:59 +0100 Subject: [PATCH 1/2] FIX: Not showing sellprice properly on product list --- htdocs/product/list.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 6451f8bdde5..b9a2fda5147 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -10,6 +10,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Adolfo segura * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2016 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -79,6 +80,7 @@ if ($type === '0') { $contextpage='productlist'; if ($search_type=='') $search_t // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array($contextpage)); $extrafields = new ExtraFields($db); +$form=new Form($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('product'); @@ -120,6 +122,15 @@ if (! empty($conf->barcode->enabled)) { $fieldstosearchall['p.barcode']='Gencod'; } +if (empty($conf->global->PRODUIT_MULTIPRICES)) +{ + $titlesellprice=$langs->trans("SellingPrice"); + if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) + { + $titlesellprice=$form->textwithpicto($langs->trans("SellingPrice"), $langs->trans("DefaultPriceRealPriceMayDependOnCustomer")); + } +} + // Definition of fields for lists $arrayfields=array( 'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), @@ -176,7 +187,6 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP */ $htmlother=new FormOther($db); -$form=new Form($db); if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { @@ -402,16 +412,7 @@ else print ''; } - if (empty($conf->global->PRODUIT_MULTIPRICES)) - { - $titlesellprice=$langs->trans("SellingPrice"); - if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) - { - $titlesellprice=$form->textwithpicto($langs->trans("SellingPrice"), $langs->trans("DefaultPriceRealPriceMayDependOnCustomer")); - } - } - - $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields print ''; From a1bc5dcc310f10616e12ec31a3f8ce1622b5b650 Mon Sep 17 00:00:00 2001 From: fmarcet Date: Wed, 16 Mar 2016 16:35:07 +0100 Subject: [PATCH 2/2] FIX: Not showing sellprice properly on product list --- htdocs/product/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index b9a2fda5147..68b4c67ad72 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -412,7 +412,7 @@ else print ''; } - $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields print '
';