pouc Posted March 10, 2015 Share Posted March 10, 2015 (edited) Bonjour je souhaiterais dans commandes->commande ameliorer ajouter le champ société quelqu'un aurait-il une idée? J'ai commencé dans adminmulistcommandes lg236 'societe' => array('title' => $this->l('Societe'), 'widthColumn' => 120, 'width' => 100, 'filter_key' => 'company', 'tmpTableFilter' => true, 'callback' => 'detailCustomer', 'class_callback' => 'admindmulistecommandes'), mais ça me retourne un message d'erreur dès que je tape quelque chose dans le champs de recherche. j'ai ensuite continué sur le même fichier lg465 ou j'ai copié la même fonction que pour la recherche client public function detailCustomer($customer, $tr) { $delivery = new Address($tr['id_address_delivery']); $customer = new Customer($tr['id_customer']); $iso = Country::getIsoById($delivery->id_country); $title = '<strong>'.$customer->firstname." <span class='upper'>".$customer->lastname.'</span></strong><br/> <em>'.$customer->email.'</em><br/><br/> <strong>'.$this->text_shipping.' :</strong><br/> '.$delivery->firstname.' '.$delivery->lastname.'<br/> '.str_replace('"', '', $delivery->address1).'<br/> '.(!empty($delivery->address2) ? str_replace('"', '', ($delivery->address2)).'<br/>' : '') .$delivery->postcode.' '.$delivery->city.'<br/> '.$delivery->country; return '<img alt="'.$iso.'" src="/modules/dmulistecommandes/pays/'.$iso.'.png" width="14" /> <a href="javascript:;" class="lien_customer'.((Tools::getBrightness($tr['color']) < 128) ? '_white' : '').'" title="'.$title.'">'.substr($customer->firstname, 0, 1).'. <span class="upper">'.$customer->lastname.'</span></a>'; } public function detailCompany($customer, $tr) { $delivery = new Address($tr['id_address_delivery']); $customer = new Customer($tr['id_customer']); $iso = Country::getIsoById($delivery->id_country); $title = '<strong>'.$customer->firstname." <span class='upper'>".$customer->lastname.'</span></strong><br/> <em>'.$customer->email.'</em><br/><br/> <strong>'.$this->text_shipping.' :</strong><br/> '.$delivery->firstname.' '.$delivery->lastname.'<br/> '.str_replace('"', '', $delivery->address1).'<br/> '.(!empty($delivery->address2) ? str_replace('"', '', ($delivery->address2)).'<br/>' : '') .$delivery->postcode.' '.$delivery->city.'<br/> '.$delivery->country; return '<img alt="'.$iso.'" src="/modules/dmulistecommandes/pays/'.$iso.'.png" width="14" /> <a href="javascript:;" class="lien_customer'.((Tools::getBrightness($tr['color']) < 128) ? '_white' : '').'" title="'.$title.'">'.substr($customer->firstname, 0, 1).'. <span class="upper">'.$customer->lastname.'</span></a>'; } Merci. Baptiste Edited March 16, 2015 by pouc (see edit history) Link to comment Share on other sites More sharing options...
pouc Posted March 17, 2015 Author Share Posted March 17, 2015 up!! Link to comment Share on other sites More sharing options...
J. Danse Posted March 18, 2015 Share Posted March 18, 2015 Bonjour, Premièrement, ce controlleur n'est pas natif. Il provient d'un module ou d'une surcharge. On ne peut donc pas "tester" à l'aveugle, à dire vrai. Deuxièmement, on ne peut d'autant pas que nous n'avons pas l'erreur retournée et si on doit en déterminer le type par nous même, ça risque d'être relativement difficile (même si j'ai mon idée sur sa nature). La mentionner ne serait-elle pas plus bénéfique pour obtenir une réponse qu'un "up!!" ? ;-) Link to comment Share on other sites More sharing options...
pouc Posted March 18, 2015 Author Share Posted March 18, 2015 C'est pas faux!! autant pour moi!=) Du coup le message d'erreur c'est "mauvaise requête sql" j'ai apporté d'autre modification sur le code : 'company' => array('title' => $this->l('Societe'), 'widthColumn' => 120, 'width' => 100, 'filter_key' => 'company', 'tmpTableFilter' => true, 'callback' => 'detailCustomer', 'class_callback' => 'admindmulistecommandes'), public function detailCompany($company, $tr) Mzis toujours le même message d'erreur. Merci. Link to comment Share on other sites More sharing options...
J. Danse Posted March 18, 2015 Share Posted March 18, 2015 Pas de soucis ; :-) Vous avez activé le mode DEV ? Car il se pourrait que la requête SQL vous soit ainsi affichée, vous pourrez voir l'erreur plus amplement, je pense bien Link to comment Share on other sites More sharing options...
pouc Posted March 18, 2015 Author Share Posted March 18, 2015 tout ce que j'ai c'est ça :"This tab is an AdminTab" Link to comment Share on other sites More sharing options...
J. Danse Posted March 18, 2015 Share Posted March 18, 2015 Ok, ... Quelle version de PrestaShop utilisée, déjà, tiens ? Link to comment Share on other sites More sharing options...
pouc Posted March 18, 2015 Author Share Posted March 18, 2015 la 1.5.6.1 Link to comment Share on other sites More sharing options...
pouc Posted March 18, 2015 Author Share Posted March 18, 2015 (edited) Alors j'ai plus ou moins réussi le champ de recherche fonctionne par contre les résultats s'affiche pas comme je le voudrais. pour l'instant j'ai ceci: ligne 189 admindmulistecommade j'ai rajouter un élément dans la requête: $this->_select = ' a.id_order AS id_pdf, cl.name AS carrier_name, CONCAT(c.`company`, \' \', c.`firstname`) AS company1, CONCAT(c.`lastname`, \' \', c.`firstname`) AS customer, osl.`name` AS `osname`, os.`color`, IF((SELECT COUNT(so.id_order) FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer) > 1, 0, 1) as new, (SELECT COUNT(od.`id_order`) FROM `'._DB_PREFIX_.'order_detail` od WHERE od.`id_order` = a.`id_order` GROUP BY `id_order`) AS product_number'; Ensuite ligne 242 et 255 'company1' => array('title' => $this->l('Societe'), 'filter_key' => 'company1', 'tmpTableFilter' => true, 'callback' => 'detailCompany1', 'class_callback' => 'admindmulistecommandes'), Et ligne 482 : public function detailCompany1($customer, $tr) { $delivery = new Address($tr['id_address_delivery']); $company1 = new Customer($tr['id_customer']); $iso = Country::getIsoById($delivery->id_country); $title = '<strong>'.$customer->company." <span class='upper'>".$customer->firstname.'</span></strong><br/> <em>'.$customer->email.'</em><br/><br/> <strong>'.$this->text_shipping.' :</strong><br/> '.$delivery->firstname.' '.$delivery->company.'<br/> '.str_replace('"', '', $delivery->address1).'<br/> '.(!empty($delivery->address2) ? str_replace('"', '', ($delivery->address2)).'<br/>' : '') .$delivery->postcode.' '.$delivery->city.'<br/> '.$delivery->country; return '<img alt="'.$iso.'" src="/modules/dmulistecommandes/pays/'.$iso.'.png" width="14" /> <a href="javascript:;" class="lien_customer'.((Tools::getBrightness($tr['color']) < 128) ? '_white' : '').'" title="'.$title.'">'.substr($customer->firstname, 0, 1).'. <span class="upper">'.$customer->lastname.'</span></a>'; } Au niveau des résultats ça fonctionne sauf qu'ils apparaissent dans le champs clients et non dans le champ société. je continue à chercher et mettrais à jour mes résultats. Baptiste Edited March 18, 2015 by pouc (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