Using jQuery in prestashop

0

Trying to use jQuery in my theme, I find that when going to use it with the following code:

$(document).ready(function(){ // aqui mi codigo..... });

I get the error that '$' is not defined, as if jQuery was not loaded. I see in console that Prestashop automatically loads jquery-ui but not jquery "normal". I add the library but it starts to get more errors (I guess that prestashop because I use jquery internally).

How can I work with jquery in prestashop then? I add the jquery file in javascript.tpl but it gives me the problems you see above.

    
asked by Marcos 13.03.2017 в 16:32
source

1 answer

0

The solution:

The problem was that the jQuery library was loading just after loading the isotope.js so it did not recognize what the library had.

Once the load order has been changed (1st jQuery - 2nd isotope) everything works perfectly. ;)

    
answered by 14.03.2017 в 11:51