Jump to content

PS 1.6.1.1 JS file not loaded


Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...