Merge branch 'ticket/r13444-new-columns-BO-products' into dev
This commit is contained in:
commit
b67527da24
@ -138,6 +138,8 @@ class AdminProductsController extends AdminProductsControllerCore
|
|||||||
LIMIT 1
|
LIMIT 1
|
||||||
) as specific_price, a.wholesale_price';
|
) 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)
|
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.') ';
|
$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'),
|
'title' => $this->l('Category'),
|
||||||
'filter_key' => 'cl!name',
|
'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(
|
$this->fields_list['wholesale_price'] = array(
|
||||||
'title' => $this->l('Prix d\'achat'),
|
'title' => $this->l('Prix d\'achat'),
|
||||||
'type' => 'price',
|
'type' => 'price',
|
||||||
@ -204,6 +214,15 @@ class AdminProductsController extends AdminProductsControllerCore
|
|||||||
'search' => false
|
'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*/
|
/*Override Antadis*/
|
||||||
$this->fields_list['specific_price'] = array(
|
$this->fields_list['specific_price'] = array(
|
||||||
'title' => $this->l('Reduction'),
|
'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.'),
|
//'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(
|
$this->fields_list['active'] = array(
|
||||||
'title' => $this->l('Status'),
|
'title' => $this->l('Status'),
|
||||||
'active' => 'status',
|
'active' => 'status',
|
||||||
@ -303,4 +338,14 @@ class AdminProductsController extends AdminProductsControllerCore
|
|||||||
$this->errors[] = Tools::displayError('Le poids de ce produit doit être défini');
|
$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" : "--";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user