mistertendance Posted December 17, 2015 Share Posted December 17, 2015 Bonjour à tous, je viens ici après quelques heures de tests qui n'ont rien donné, j'essaie d'afficher dans la page commandes >> retours produits le nom du client dans la liste pour m'y retrouver plus facilement voici le code du >>controllers >> admin >> adminreturncontroller.php class AdminReturnControllerCore extends AdminController { public function __construct() { $this->bootstrap = true; $this->context = Context::getContext(); $this->table = 'order_return'; $this->className = 'OrderReturn'; $this->colorOnBackground = true; $this->_select = 'ors.color, orsl.`name`, o.`id_shop`'; $this->_join = 'LEFT JOIN '._DB_PREFIX_.'order_return_state ors ON (ors.`id_order_return_state` = a.`state`)'; $this->_join .= 'LEFT JOIN '._DB_PREFIX_.'order_return_state_lang orsl ON (orsl.`id_order_return_state` = a.`state` AND orsl.`id_lang` = '.(int)$this->context->language->id.')'; $this->_join .= ' LEFT JOIN '._DB_PREFIX_.'orders o ON (o.`id_order` = a.`id_order`)'; $this->fields_list = array( 'id_order_return' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'id_order' => array('title' => $this->l('Order ID'), 'width' => 100, 'align' => 'center', 'filter_key'=>'a!id_order'), 'name' => array('title' => $this->l('Status'),'color' => 'color', 'width' => 'auto', 'align' => 'left'), 'date_add' => array('title' => $this->l('Date issued'), 'width' => 150, 'type' => 'date', 'align' => 'right', 'filter_key'=>'a!date_add'), ); à mon avis ca se passe ici mais avec mes différentes jointures j'y suis pas arrivé ... si quelqu'un pouvait m'aider ce serait magnifique merci d'avance à la communauté prestashop Link to comment Share on other sites More sharing options...
mistertendance Posted January 10, 2016 Author Share Posted January 10, 2016 (edited) c'est bon j'ai trouvé donc si cela peut aider quelqu'un... class AdminReturnControllerCore extends AdminController { public function __construct() { $this->bootstrap = true; $this->context = Context::getContext(); $this->table = 'order_return'; $this->className = 'OrderReturn'; $this->colorOnBackground = true; $this->_select = 'ors.color, orsl.`name`, o.`id_shop`, c.`firstname`, c.`lastname`'; $this->_join = 'LEFT JOIN '._DB_PREFIX_.'order_return_state ors ON (ors.`id_order_return_state` = a.`state`)'; $this->_join .= 'LEFT JOIN '._DB_PREFIX_.'order_return_state_lang orsl ON (orsl.`id_order_return_state` = a.`state` AND orsl.`id_lang` = '.(int)$this->context->language->id.')'; $this->_join .= ' LEFT JOIN '._DB_PREFIX_.'orders o ON (o.`id_order` = a.`id_order`)'; $this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.id_customer = a.id_order)'; $this->fields_list = array( 'id_order_return' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'id_order' => array('title' => $this->l('Order ID'), 'width' => 100, 'align' => 'center', 'filter_key'=>'a!id_order'), 'firstname' => array('title' => $this->l('First Name'), 'filter_key' => 'c!firstname'), 'lastname' => array('title' => $this->l('Last Name'), 'filter_key' => 'c!lastname'), 'name' => array('title' => $this->l('Status'),'color' => 'color', 'width' => 'auto', 'align' => 'left'), 'date_add' => array('title' => $this->l('Date issued'), 'width' => 150, 'type' => 'date', 'align' => 'right', 'filter_key'=>'a!date_add'), ); Edited January 10, 2016 by mistertendance (see edit history) 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