Jump to content

[SOLVED]Is it possible to add multiple js-files with hookDisplayHeader in controller?


Recommended Posts

Hi everyone, 

I'm working on an existing module and I'm really new to PrestaShop. We want to display buttons bellow the carrier's we add with the our module. The way we do it for now is by loading a javascript file containing code to display those buttons.

This all happens in the hook DisplayHeader.

 1.7: 

$controller->registerJavascript(
'module-our-script',
'http://cdnForOurJavascript.js',
array('server' => 'remote')
);

 1.6:

$controller->addJS('http://cdnForOurJavascript.js', false);

The problem is if I run this function again, it "overrides" the previous added js-file.

Is there a way to add multiple javascript files to the controller ? 

Thanks in advance for your responses, if some things don't seem clear it's because my understanding of the software is still limited, feel free to correct me if I say something wrong !

 

Have a nice day.

Edited by mathdex (see edit history)

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More