Jump to content

jquery 3.2 in prestashop 1.7


cchris-king
 Share

Recommended Posts

hello i have posted before about how to use jquery in prestashop 1.7 product pages but i relly didn't get answer i think the community is not so active, 

anyway i hope i can get help this time, so want to use jquery in my product page for smooth parallax scroll, but i don't know where to write my jquery code, in core.js ? or  create my js file then include in product.tpl and how ? i also downloaded jquery3.2.1 in js/jquery/, but really don't know how to use it i have read the asset managements documents on prestashop support but i really don't understand anything they say, 

Share this post


Link to post
Share on other sites

1 hour ago, Katamariz said:

What you can do is embed it between the <head></head> in layout-both-columns.tpl, which you can find in you themes /templates/layouts  folder.

Good luck!

thanks you so much i did it but i got an error in the navigator chrome and firefox 

Quote

Uncaught SyntaxError: Unexpected token <

 

Share this post


Link to post
Share on other sites

try this :

on package.json

"jquery": "^3.2.1",

then npm install jquery

if you want add js on product page go to  mytheme/_dev/js/product.js

then npm run build, this will compile everyting into your asset theme.js

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
 Share

×
×
  • Create New...

Important Information

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