yannfanch Posted April 2, 2018 Share Posted April 2, 2018 Bonsoir. je suis en 1.6.1.18 et j'ai rajouté une colonne Fabricant dans la liste des produits dans BO. mais cette colonne n'indique que l'ID et non le nom. Comment corriger ce code pour lié la table manufacturer et rapatrier le nom? Voici mon override: <?php class AdminProductsController extends AdminProductsControllerCore { public function __construct() { parent::__construct(); $this->fields_list['id_manufacturer'] = array( 'title' => $this->l('Id Fabricant'), 'align' => 'left', ); } } ---------------------------------------------------------------------------------------------------- Link to comment Share on other sites More sharing options...
yannfanch Posted April 4, 2018 Author Share Posted April 4, 2018 Voici ce que j'ai trouvé pour overrider AdminProductsController.php: <?php class AdminProductsController extends AdminProductsControllerCore { public function __construct() { parent::__construct(); // On joint la table ps_manufacturer ou la référence est stockée $this->_join .= ' INNER JOIN '._DB_PREFIX_.'manufacturer mp ON ( a.id_manufacturer = mp.id_manufacturer )'; //Ajout du champs dans la liste des champs affichés dans l'amdmin $this->fields_list['id.manufacturer'] = array( 'title' => $this->l('Fabricant'), 'align' => 'left', 'filter_key' => 'mp!name', 'width' => 80 ); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now