jd440 Posted November 27, 2013 Share Posted November 27, 2013 (edited) Bonjour à tous. Voilà j'essaye de developper un module tout simple pour simplement ajouter un fichier JS dans le header Mais je comprend pas, car le module s'installe, s'accroche, mais le JS ne s'ajouter pas? Si quelqu'un trouve ou je fait un erreur: <?php if (!defined('_PS_VERSION_')) exit; class LazyLoad extends Module { public function __construct() { $this->name = 'lazyload'; $this->tab = 'front_office_features'; $this->version = 1.0; $this->author = 'jd440'; $this->displayName = $this->l('Lazyload'); $this->description = $this->l('Lazyload'); parent :: __construct(); } public function install() { return parent :: install() && $this->registerHook('displayHeader'); } public function displayHeader($param) { $this->context->controller->addJS($this->_path.'js/jquery.lazyload.min.js'); } } Merci d'avance. Edited November 27, 2013 by jd440 (see edit history) Link to comment Share on other sites More sharing options...
jd440 Posted November 27, 2013 Author Share Posted November 27, 2013 J'ai réussit en utilisant le :DisplayTop mais pas Header Quelqu'un serait pourquoi? pourtant dans la doc on trouve: displayHeader Called within the HTML <head> tags. Ideal location for adding JavaScript and CSS files. http://doc.prestashop.com/display/PS15/Les+hooks+de+PrestaShop+1.5 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