Describe the bug
In the FO => Product details page, the button add to cart is enabled when minimal quantity > quantity of the product but it shouldn't
Same issue with a product that has combinations.
To Reproduce
Steps to reproduce the behavior:
Tried with 1724 => OK
With the branch 1.7.7.x => the button is also enabled, but when we click "add to cart" we have an alert
The product is no longer available in this quantity.
When we refresh the page => products are well added to cart
Related to this: https://github.com/PrestaShop/PrestaShop/issues/13374
Additional information
PrestaShop version: 1.7.4.2, 1.7.5.2, 1.7.6.3, 1.7.7.x
PHP version: 7.2
Thank you @khouloudbelguith for mentioning precisely the exact version (1.7.2.4) after which the behaviour was broken. That helps a lot :+1:
The same issue with a product which has combinations
Thanks!
En Principe, the PR I created should also fix this issue.
But theoretically, other things may not work. Like switching back and forth combinations from FO. As you know, such operations require AJAX and maybe the disabled button will have unwanted behaviour. I have strong belief that a processing is done differently between the two things: initial page loading vs AJAX loading. So thank you @khouloudbelguith for raising this issue. Let me put more thought about it and feedback. Meanwhile, I have put my PR to WIP.
@khouloudbelguith, I have modified the PR to fix that issue too. Now even if you switch between de combinations in FO product page, the add to cart button get disabled if quantity of combination is lower than minimal allowed quantity. Thank you very much