Air Chaser Posted May 3, 2016 Share Posted May 3, 2016 Hi, So, I have been working on revamping a website and I have to move all the inline and header JavaScript and to the footer of the site. In other platforms it has been a pretty straight forward process, I hope Prestashop is no different. For What I understand so far of the platform I have 3 options how to go about it. Create a custom hook on the footer of the site, create a custom module and hook all my scripts using the module and if statements. This sounds like a hack though. Create a custom hook and somehow attached the scripts from individual controllers. This would best case scenario but I can't figure out how to connect ProductControllerCore.php for example to a custom hook to accomplished this. The most viable option I can think of right now, is to place all the scripts directly onto the footer.tpl and using individual controllers set smarty variables to let scripts display or hide scripts depending on the controllers needs. This one feels like a hack as well but I cant really think of any other way. Any help or insight into this issue would very much appreciated. Link to comment Share on other sites More sharing options...
vekia Posted May 3, 2016 Share Posted May 3, 2016 hello prestashop has option to move scripts by default, its available from preferences > performance section. You dont have to create new hooks, modify modules to support these new positions. just one simple switch on preferences > performance page. 2 Link to comment Share on other sites More sharing options...
Air Chaser Posted May 11, 2016 Author Share Posted May 11, 2016 Thanks. Case closed Link to comment Share on other sites More sharing options...
alicu90 Posted May 7, 2017 Share Posted May 7, 2017 hello prestashop has option to move scripts by default, its available from preferences > performance section. You dont have to create new hooks, modify modules to support these new positions. just one simple switch on preferences > performance page. Which is the option in Prestashop 1.7 to move all the scripts? 1 Link to comment Share on other sites More sharing options...
jacopo.pace Posted February 7, 2018 Share Posted February 7, 2018 (edited) On 7/5/2017 at 6:39 PM, alicu90 said: Which is the option in Prestashop 1.7 to move all the scripts? I quote! It seems in PS 1.7 there's no option to move scripts top or bottom. Moreover: I'm having the scripts replicated both top and bottom! Edited February 7, 2018 by jacopo.pace (see edit history) Link to comment Share on other sites More sharing options...
vinod.r2020 Posted June 11, 2020 Share Posted June 11, 2020 On 5/3/2016 at 2:20 PM, vekia said: hello prestashop has option to move scripts by default, its available from preferences > performance section. You dont have to create new hooks, modify modules to support these new positions. just one simple switch on preferences > performance page. Thankyou so much vekia you saved my time Link to comment Share on other sites More sharing options...
DARKF3D3 Posted February 1, 2022 Share Posted February 1, 2022 How can you do this on PS1.7.7? I can't find this option. Link to comment Share on other sites More sharing options...
ComGrafPL Posted February 1, 2022 Share Posted February 1, 2022 3 minutes ago, DARKF3D3 said: How can you do this on PS1.7.7? I can't find this option. Isn't that, Visual->Positions? Link to comment Share on other sites More sharing options...
DARKF3D3 Posted February 1, 2022 Share Posted February 1, 2022 But in that way I have to move manually all the modules hook, and I'm not sure if this doesn't cause any problems to them. I was wondering if there's an option to tell prestashop to load everything on top or bottom, because I saw that prestashop demo website load all js files into the footer, while on my website they're all loaded into the header. 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