gnoma Posted June 27, 2013 Share Posted June 27, 2013 Hi guys First of all, sorry for my English. I have unsuccessfully been looking for a solution to my problem. I'm developing a module which overrides an admin controller class. The base controller loads a javascript file, let's say /js/foo.js, through $this->addJS(_PS_JS_DIR_.'foo.js') which is ok. But the point is I also need to override that javascript file. Placing a newly created js file in /override/js/foo.js takes no effect. Is it possible to override a JavaScript file? I'm opened to other solutions, i.e. directly adding a custom js file, but the only way I can figure out is by hardcoding the URL (which of course is not ok). How can a module js file be loaded by a overridden controller without hardcoding its path? Thanks a lot. Link to comment Share on other sites More sharing options...
elvizgz Posted October 10, 2013 Share Posted October 10, 2013 (edited) Hello there, I have the same problem. I've tried to locate the file in many places (inside the theme, in the override folder, etc.) but I can't make it work. Any idea of how to override a js file located in /js folder? Thanks in advance. Edited October 16, 2013 by elvizgz (see edit history) Link to comment Share on other sites More sharing options...
alsitn Posted October 10, 2013 Share Posted October 10, 2013 Hi gnoma, are you developing a module or an override? As far as I know, if it's a module you have to put all the js files required under %root%/modules/my_module/js/ or %root%/themes/(default or)my_theme/modules/my_module/js/ in case you are overriding an existing module 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