[email protected] Posted March 22, 2018 Share Posted March 22, 2018 (edited) If you enter the quantity and then press the „Enter / Return Key“ without touching the "ADD TO CART" button, the product will be automatically added to the shopping cart. How can this be prevented? Please watch the video... Edited March 22, 2018 by [email protected] (see edit history) Link to comment Share on other sites More sharing options...
tantan199 Posted March 23, 2018 Share Posted March 23, 2018 You can put this code to the custom.js file to avoid that. $(document).ready(function() { $('#add-to-cart-or-refresh').on('keyup keypress', function(e) { var keyCode = e.keyCode || e.which; if (keyCode === 13) { e.preventDefault(); return false; } }); }); Here is a free module which allows you to add custom css and javascript to your site without editing files. Prestashop 1.7 custom code module Link to comment Share on other sites More sharing options...
[email protected] Posted March 23, 2018 Author Share Posted March 23, 2018 Thank you so much! This works - PERFECT!!!! Link to comment Share on other sites More sharing options...
[email protected] Posted March 23, 2018 Author Share Posted March 23, 2018 23 minutes ago, [email protected] said: Thank you so much! This works - PERFECT!!!! Is there a way to get out of the field after pressing ENTER instead of staying in the field? 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