BluTiGeS Posted December 17, 2018 Share Posted December 17, 2018 Hello, I am facing a problem at PS 1.7.2.2 where I wanted to use Javascript files for my module. But the above hook does not include any JS file to the Products Page (but CSS files are added). But it works for the ProductList and other pages, where I use it. Do I need to use another hook for including the JS files after JQuer Core has been included for the Product Page? public function hookdisplayHeader( $params ) { $this->context->controller->registerJavascript('modules-mymod1', 'modules/'.$this->name.'/views/js/myjs1.js', array('position' => 'bottom', 'priority' => 100)); $this->context->controller->registerJavascript('modules-mymod2', 'modules/'.$this->name.'/views/js/myJS.js', array('position' => 'bottom', 'priority' => 150)); } Many Thanks in advance Link to comment Share on other sites More sharing options...
BluTiGeS Posted December 17, 2018 Author Share Posted December 17, 2018 using hookActionFrontControllerSetMedia did not change the behaviour. Can the JAvascript hooks be disabled at the produts page? Link to comment Share on other sites More sharing options...
JBW Posted December 17, 2018 Share Posted December 17, 2018 Try hookHeader instead. I remember issues with paths in registerJavascript, so you can also try $this->context->controller->addJS which is depreceated though. 1 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