====== Modifier le back-office ====== ===== Changer des listes affichées en back-office ===== Goto AdminMachinController -> Chercher $this->fields_list http://doc.prestashop.com/display/PS16/Adding+a+configuration+page ==== Exemple avec callback ==== 'is_pro' => array( 'title' => $this->l('Pro - valid'), 'align' => 'text-center', 'type' => 'bool', 'orderby' => false, 'callback' => 'isProValid', ), Fonction dans le même fichier : // Fonction pour afficher si le client est pro, et s'il est ou non dans le groupe des pros non validés public function isProValid($value, $customer) { if ($value) { $return = ' - '; } else { return ' - '; } $groups = Customer::getGroupsStatic($customer['id_customer']); $valid = true; for( $i = 0, $max = count($groups) ; $i < $max ; $i++ ) { if ( $groups[$i] == 4 ) { $return .= ''; $valid = false; } } if($valid) { $return .= ''; } return $return; } ===== Changer les vues affichées en back-office ===== Pour ça il faut modifier les templates du thème admin. Ils se trouvent dans **/admin/themes/nom_du_theme/template/controllers/nom_du_controlleur/helpers/view/view.tpl** ===== Ajouter un menu ===== Pour un module (need a controller). À l'installation : public function install() { // ... // On met le menu dans Administration $presta_pop_tab = new Tab(); $presta_pop_tab->class_name = 'AdminPrestaPop'; $presta_pop_tab->module = 'presta_pop'; $presta_pop_tab_admin_id = Tab::getIdFromClassName('AdminAdmin'); if ($presta_pop_tab_admin_id) { $presta_pop_tab->id_parent = $presta_pop_tab_admin_id; } else { $presta_pop_tab->id_parent = 0; } foreach (Language::getLanguages(true) as $lang) { $presta_pop_tab->name[$lang['id_lang']] = 'Presta pop'; } $presta_pop_tab->save(); // ... } Désinstallation : public function uninstall() { // ... // Virer le lien dans le menu $presta_pop_tab_id = Tab::getIdFromClassName('AdminPrestaPop'); if ($presta_pop_tab_id) { $presta_pop_tab = new Tab($presta_pop_tab_id); $presta_pop_tab->delete(); } // ... } === Lui donner une icône === function install() { if (parent::install() == false || $this->registerHook('displayBackOfficeHeader') == false) { return false; } // ... } public function hookDisplayBackOfficeHeader($params) { return '"'; }