Birze Posted May 27, 2024 Share Posted May 27, 2024 Hi, Prestashop 1.7.8.11 On backend, in product combination enter minimal quanity for sale: 50 Then, on frontend product page, when trying to enter quantity 100 by keyboard (or any value from 100 to 499), the quantity jumps back to 50. Link to comment Share on other sites More sharing options...
Prestashop Addict Posted May 27, 2024 Share Posted May 27, 2024 This an issue, it works only if you use arrows 😞 Link to comment Share on other sites More sharing options...
Birze Posted May 28, 2024 Author Share Posted May 28, 2024 Apparently the problem is in theme.js file. Someone suggested to change ("" === t.val() || t.val() < t.attr("min")) && (t.val(t.attr("min")), t.trigger("change")) with ("" === t.val() || **parseInt**(t.val()) < **parseInt**(t.attr("min"))) && (t.val(t.attr("min")), t.trigger("change")) But something is not quite right. It removed the problem, but now arrows are missing and "Add to Cart" button doesn't work Link to comment Share on other sites More sharing options...
Birze Posted May 28, 2024 Author Share Posted May 28, 2024 Looks like this is the correct code that works. In theme.js change: t.focusout(function(){(""===t.val()||t.val()<t.attr("min"))&&(t.val(t.attr("min")),t.trigger("change"))}) to: t.focusout(function(){(""===t.val()||parseInt(t.val())<parseInt(t.attr("min")))&&(t.val(t.attr("min")),t.trigger("change"))}) 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