alizeeee Posted March 20, 2020 Share Posted March 20, 2020 I need to track when user clicks on +1 ou -1 in product quantity inside cart in order to increase / decrease a product quantity. When I bind click event on +1/-1 buttons, my code is not fired (inside theme.js). I wonder if Prestashop behavior stops my event binding. How could I track these events ? Thanks Link to comment Share on other sites More sharing options...
JBW Posted March 20, 2020 Share Posted March 20, 2020 How do you bind it? It works for me with $(".js-increase-product-quantity").on("click", function(){alert("Test")}) Link to comment Share on other sites More sharing options...
joseantgv Posted March 20, 2020 Share Posted March 20, 2020 And where/when do you add your script? Link to comment Share on other sites More sharing options...
alizeeee Posted March 20, 2020 Author Share Posted March 20, 2020 @JBW I tried your code and it doesn't work. @joseantgv I add my script by importing a custom js file in my theme.js before import './responsive'; import './checkout'; import './customer'; import './listing'; import './product'; import './cart'; Link to comment Share on other sites More sharing options...
JBW Posted March 20, 2020 Share Posted March 20, 2020 8 minutes ago, alizeeee said: @JBW I tried your code and it doesn't work. As you can see in my screenshot it works You didnt answer how you bind your code.... Link to comment Share on other sites More sharing options...
alizeeee Posted March 20, 2020 Author Share Posted March 20, 2020 @JBW I tested your code inside $(document).ready $(document).ready(function(){ $(".js-increase-product-quantity").on("click", function(){alert("Test")}) } 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