addJS function not working for admin in prestashop

后端 未结 5 1820
星月不相逢
星月不相逢 2021-01-14 05:52

I am trying to add javascript file in prestashop admin using backOfficeHeader hook using a module but nothing happened. My code is given below.

         


        
5条回答
  •  醉话见心
    2021-01-14 06:39

    did u try to check addJS path? I think nothing more can be possible if other JS files working. Try to use $this->_path.

    $this->context->controller->addJS($this->_path.'views/js/hs_custom.js');
    

    1) Output path and check if it is valid. 2) Reload page and check network. Page load your script or not? 3) Remember to reset module if u change something with hooks. 4) Check module hooks.

提交回复
热议问题