diff --git a/override/controllers/admin/AdminProductsController.php b/override/controllers/admin/AdminProductsController.php index fd35fb77..ec30fc9a 100644 --- a/override/controllers/admin/AdminProductsController.php +++ b/override/controllers/admin/AdminProductsController.php @@ -129,7 +129,7 @@ class AdminProductsController extends AdminProductsControllerCore $this->_select .= 'shop.name as shopname, a.id_shop_default, '; $this->_select .= 'MAX('.$alias_image.'.id_image) id_image, cl.name `name_category`, '.$alias.'.`price`, 0 AS price_final, a.`is_virtual`, pd.`nb_downloadable`, sav.`quantity` as sav_quantity, '.$alias.'.`active`, IF(sav.`quantity`<=0, 1, 0) badge_danger'; - + /*Override Antadis*/ $this->_select .= ', ( SELECT ROUND((sp.reduction * 100),0) as specific_price @@ -138,6 +138,8 @@ class AdminProductsController extends AdminProductsControllerCore LIMIT 1 ) as specific_price, a.wholesale_price'; + $this->_select .= ', IF(a.unit_price_ratio >0, a.price/a.unit_price_ratio,0) as unit_price '; + if ($join_category) { $this->_join .= ' INNER JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = a.`id_product` AND cp.`id_category` = '.(int)$this->_category->id.') '; @@ -181,6 +183,14 @@ class AdminProductsController extends AdminProductsControllerCore 'title' => $this->l('Category'), 'filter_key' => 'cl!name', ); + + // antadis 13444 + $this->fields_list['weight'] = array( + 'title' => $this->l('Poids (kg)'), + 'align' => 'text-right' + ); + // end antadis + $this->fields_list['wholesale_price'] = array( 'title' => $this->l('Prix d\'achat'), 'type' => 'price', @@ -204,6 +214,15 @@ class AdminProductsController extends AdminProductsControllerCore 'search' => false ); + /* antadis 13444 */ + $this->fields_list['unit_price'] = array( + 'title' => $this->l('Prix unitaire'), + 'align' => 'text-right', + 'callback' => 'displayUnitPrice', + 'search' => false, + ); + /* end antadis */ + /*Override Antadis*/ $this->fields_list['specific_price'] = array( 'title' => $this->l('Reduction'), @@ -224,6 +243,22 @@ class AdminProductsController extends AdminProductsControllerCore //'hint' => $this->l('This is the quantity available in the current shop/group.'), ); + // antadis 13444 : refer to the module "ExtraTabs" + if (Module::isEnabled('extratabs')) { + $this->_select .= ', \'1\' as extra_tabs'; + + $this->fields_list['extra_tabs'] = array( + 'title' => $this->l('Extratabs'), + 'align' => 'text-center', + 'type' => 'bool', + 'class' => 'fixed-width-sm', + 'callback' => 'hasExtratabs', + 'orderby' => false, + 'search' => false + ); + } + // end entadis + $this->fields_list['active'] = array( 'title' => $this->l('Status'), 'active' => 'status', @@ -303,4 +338,14 @@ class AdminProductsController extends AdminProductsControllerCore $this->errors[] = Tools::displayError('Le poids de ce produit doit être défini'); } } + + public static function displayUnitPrice($value, $tr) + { + return Tools::displayPrice($value, Context::getContext()->currency->id); + } + + public static function hasExtratabs($value, $tr) + { + return ProductExtraTabModel::getMaxPosition($tr['id_product'])>0 ? "oui" : "--"; + } }