Q:

Add custom Javascript to Prestashop

After asking on the Prestashop forum and receiving no reply I wanted to ask you guys and hope for an answer.
I am trying to add an animated snow plugin to my shop but after looking at the header.tpl file which instructs you to not edit - how do I add my own Javascript to the head of my template?
I duplicated the default-theme and I am working from that.

A:

If the theme is default-bootstrap, then yes, you probably shouldn't modify it, if you intend to upgrade it (can be automatically upgraded using autoupgrade module).
Same can be true for 3rd party themes which are actively updated. But usually 3rd party themes don't get upgraded at all, which means you can modify theme templates. Because the templates are sort-of too complex to be extended by a child theme, it is ok to edit them directly. PretaShop doesn't have child-parent theme system. Just edit the templates directly.
If you would like your changes to be portable accross themes, then you should probably make a module. Inside the module use special functions to add .js and .css files to header:
mymodule.php

...

public function install()
{
   ...
   $this->registerHook('displayHeader');
   ...
}

public function hookDispayHeader()
{
   $this->context->controller->addJS($this->_path.'js/script.js');
   $this->context->controller->addCSS($this->_path.'css/style.css');
}

If you need a quick way to add, just edit theme's global.css and global.js
You may also add the stysheet and script to autload folder:
themes/theme1/css/autoload/ and 
themes/theme1/js/autoload/. Files inside these folder will be loaded for all pages.

