Mcey Posted April 30, 2018 Share Posted April 30, 2018 Bonjour, Je suis en train de créer un module sur prestashop 1.7 et je souhaiterais modifier les css du module, côté ADMIN. Dans mon fichier principal .php j'ai fais un hook : public function install() { if (Shop::isFeatureActive()){ Shop::setContext(Shop::CONTEXT_ALL); } if (!parent::install() || !$this->registerHook('header') || !Configuration::updateValue('MYMODULE_PRESTA', 'Module presta') ) return false; return true && $this->registerHook('backOfficeHeader'); } public function hookBackOfficeHeader(){ $this->getContext()->controller->addCSS($this->_path.'views/css/modulepresta.css'); } Du coup ça ne fonctionne pas, donc j'ai créé un controller admin : <?php class AdminModulePresta extends ModuleAdminController { public function __construct() { $this->bootstrap = true; $this->className = 'AdminModulePrestaController'; include_once(_PS_MODULE_DIR_ . '/modulepresta/modulepresta.php'); parent::__construct(); } public function setMedia() { parent::setMedia(); $this->path = __PS_BASE_URI__.'modules/modulepresta/'; $this->context->controller->addCSS($this->path . 'views/css/modulepresta.css'); // $this->context->controller->addJS($this->path . 'js/lib/jquery.mousewheel.js'); } public function init() { parent::init(); } } Mais ça ne fonctionne toujours pas. Je vous envoie un écran du module ci-dessous, je souhaiterais juste mettre un display:flex en CSS sur mes Checkbox et boutons radio. Si vous auriez des suggestions ça m'aiderais. Je vous remercie. Link to comment Share on other sites More sharing options...
selectshop.at Posted April 30, 2018 Share Posted April 30, 2018 Please English Forum section, only English language. I'm moving your question to French forum section. Link to comment Share on other sites More sharing options...
Mcey Posted April 30, 2018 Author Share Posted April 30, 2018 I found it out. It was just in my install() function, it wasn't complete : Here is the good code : public function install() { if (Shop::isFeatureActive()){ Shop::setContext(Shop::CONTEXT_ALL); } if (!parent::install() || !$this->registerHook('header') || !$this->registerHook('backOfficeHeader') || !Configuration::updateValue('MYMODULE_PRESTA', 'Module presta') ) return false; return true && ($this->registerHook('displayHeader') || $this->registerHook('backOfficeHeader')); } 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