Bejkrools Posted August 31, 2015 Share Posted August 31, 2015 Hi! My JS files are not loading to head section, but css files are loading properly. public function install() { if (!parent::install() || !$this->registerHook('header') || !Configuration::updateValue('MINIMODULE_NAME', 'my friend') ) return false; return true; } public function hookDisplayHeader() { $this->context->controller->addCSS($this->_path.'css/minimodule.css', 'all'); $this->context->controller->addJS($this->_path.'js/minimodule.js'); } but i try also public function hookDisplayHeader($params) / hookHeader() / hookHeader($params) { $this->context->controller->addCSS($this->_path.'css/minimodule.css', 'all'); $this->context->controller->addJS($this->_path.'js/minimodule.js'); } Always only css files are loading properlu. Filename and path seems to be ok. Where is problem? Link to comment Share on other sites More sharing options...
bellini13 Posted September 1, 2015 Share Posted September 1, 2015 maybe you have CCC enabled for javascript, which causing all the js files to be compressed into a single .js file? Link to comment Share on other sites More sharing options...
zapalm Posted September 6, 2015 Share Posted September 6, 2015 check this code in the header.tpl of your working theme: {if isset($js_defer) && !$js_defer && isset($js_files) && isset($js_def)} {$js_def} {foreach from=$js_files item=js_uri} <script type="text/javascript" src="{$js_uri|escape:'html':'UTF-8'}"></script> {/foreach} {/if} 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