Monovolador Posted March 18, 2019 Share Posted March 18, 2019 (edited) Hello, I need help with js on prestashop 1.7. I want to create a button in product page that updates the number of products selected. For example: If I press red button, quantity_wanted box change to 5: How to do that? I suppose I need to modify /theme/_dev/js/product.js with something like that: $(document).ready(function(){ $('.qty_five').on('click',function(){ $('#quantity_wanted').val(parseInt($('#quantity_wanted').val())+4); }); The problem is JS doesn't work. Any idea? I need first steps to begin. Thanks! Edited March 18, 2019 by zell9999 (see edit history) Link to comment Share on other sites More sharing options...
joseantgv Posted March 18, 2019 Share Posted March 18, 2019 (edited) You only want to modify the input value or to add the units to the cart? Edited March 18, 2019 by joseantgv (see edit history) Link to comment Share on other sites More sharing options...
Monovolador Posted March 18, 2019 Author Share Posted March 18, 2019 3 hours ago, joseantgv said: You only want to modify the input value or to add the units to the cart? Hello joseantgv, Only modify input value. Link to comment Share on other sites More sharing options...
joseantgv Posted March 19, 2019 Share Posted March 19, 2019 Ok then you should debug it: - The code is output in the page? - The code is executed? - The button is found with selector? - The event click is fired? 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