Describe the bug
Product with 3 combinations
combination 1 : quantity 24 , minimal quantity 1, default combination
combination 2 : quantity 12 , minimal quantity 6
combination 3 : quantity 4 , minimal quantity 1,
To Reproduce
Steps to reproduce the behavior:
Screenshots
If applicable, add screenshots or screenrecords to help explain your problem.
Additional information
PrestaShop version: 1.7.6
PHP version: 7.1
Hi @guil182,
I did not manage to reproduce the issue with PS1.7.6.0.
I attached a screen record
https://drive.google.com/file/d/1UgKinUy9u5zyJMVuAdczg5mZvQW6PiCP/view
Thanks to check & feedback
Hi @khouloudbelguith,
Very strange. Look at : http://prestashop.lenclosdesvins.com/pomerol/23-40-chateau-la-conseillante-2010.html

@guil182, it is random in your case.
https://drive.google.com/file/d/1GaMv3fnBovUOjULvMemVS8oiSVikyMp6/view
We need to retrieve the PHP error log and the debug mode report in order to find out what's wrong.
Don't you know how to get this information? Please read the following article:
http://build.prestashop.com/howtos/misc/how-to-create-bug-report/
Thanks!
@khouloudbelguith, it's not random...
It always make an error when you clic on 6x75cl AND after on 1x150cl and newer from 6x75cl to 1x75cl.
If for combination 6x75cl, I change minimal quantity 6 to 1, "There are not enough products in stock" newer appear.
So I think that nimimal quantity of the former combination "stay somewhere" in this case...:/
@guil182, We need to retrieve the PHP error log and the debug mode report in order to find out what's wrong.
Don't you know how to get this information? Please read the following article:
http://build.prestashop.com/howtos/misc/how-to-create-bug-report/
Thanks!
@khouloudbelguith,
I was on 6x75cl and I just clic on 1x150cl
Look at the copy screen. Is qty and quantity_wanted : 6 normal ?

@guil182, yes there is an issue.
We need to retrieve the PHP error log and the debug mode report in order to find out what's wrong.
Don't you know how to get this information? Please read the following article:
http://build.prestashop.com/howtos/misc/how-to-create-bug-report/
Thanks!
@khouloudbelguith,
Excuse me but I'm in debug mode. how to have a report ? Php error log, I will have it tomorrow (OVH).
@guil182, when debug mode enabled, in the FO, go the product page & try to change the combination & check if there is an exception is displayed.
Thanks!
hello @khouloudbelguith,
No exception displayed.
No error in logs.
It's not random. I do another test...I put quantity of 1x75cl to 5...and from 6x75cl to 1x75cl "There are not enough products in stock" appear.
So, post request : http://prestashop.lenclosdesvins.com/index.php?controller=product&token=5ab75eb29a0f840c291c3d76c2c25cee&id_product=23&id_customization=0&group%5B5%5D=29&qty=6
take the former qty combination.
It's a real code bug !
It's too important for a website in production. I hope that the correction can be made quickly.
@guil182, thanks for your feedback.
Did you have some overrides of your classes?
Thanks!
@khouloudbelguith,
No, it's a fresh install of 1.7.6
@guil182, did you use a child theme?
Thanks!
@khouloudbelguith,
No, default th猫me.
@guil182, ABOUT THIS EXCEPTION:
Warning: preg_match() expects parameter 2 to be string, array given, could you please navigate to your BO => Shop Parameters => Traffic & SEO => Enable "Accented URL", clear cache, check & feedback.

Thanks!
@khouloudbelguith,
same issue :/
@guil182, the exception is still displayed in your case?
Could you please try to regenerate the file .htaccess
Thanks to check if the exception is displayed and feedback
@khouloudbelguith,
Same issue,
I tested with friendly URL disabled...same issue :/
I have no exception displayed.
@khouloudbelguith,
I have this in console
Erreur dans les liens source : request failed with status 404
URL de la ressource : http://prestashop.lenclosdesvins.com/themes/core.js
URL du lien source : core.js.map
@guil182, it is not related to your issue this error.
Finally, I found the real issue,
If we have the first combination with a minimal quantity > the quantity of the second combination, the issue appears.
I have the same issue with PS1.7.5.2 & PS1.7.6.0.
https://drive.google.com/file/d/1Y1cvCxiLFUtzy6avcIrG20Kh3rwkVHNN/view
I鈥檒l add this to the debug roadmap so that it鈥檚 fixed. If you have already fixed it on your end or if you think you can do it, please do send us a pull request!
Thanks!
@khouloudbelguith,
Ok.
It鈥檚 for you 芦聽minor聽禄? Together, we spent some hour to understand th茅 behavior. What do you think of a client in front of this product page ?
-> one only conclusion: it鈥檚 strange, with bug, not professionnal, i鈥檓 afraid, i don鈥檛 buy!
At one moment, it could be very important to spend all the Time to debug the solution instead of add some fonctionnality on a core with many bugs...
Regards
@guil182, thanks to follow this link: http://build.prestashop.com/news/severity-classification/ to introduce the New Bug Severity Classification
Thanks!
Hi @khouloudbelguith,
One year and after a fresh install of 1.7.6.7.....always the same issue and no one assigned on it ..
Regards
Hi @guil182,
Sorry, not fixed yet.
But PrestaShop is an open-source project, so it can be solved before if someone submits a pull request to solve it.
Thanks!
Hi @khouloudbelguith,
i found where is the error but i ha ve not enough prestashop architecture knowledge to solve it.
In fact, when you change combination on product page and the imput is with quantity=3 , you call ajax action refresh : ajax=1&action=refresh&quantity_wanted=3
And when you change quantity (touchspin click) you call the same action : ajax=1&action=refresh&quantity_wanted=4
To solve the problem, when you change combination, you must call ajax action refresh ALWAYS WITH quantity_wanted=1.
Regards
Hi @khouloudbelguith,
In PrestaShop/themes/_core/js/product.js
Replace l 175 : eventType === 'updatedProductCombination' ? $quantityWantedInput.attr('min') : $quantityWantedInput.val(),
by
eventType === 'updatedProductCombination' ? 1 : $quantityWantedInput.val(),
And I think it will be ok.
Can you give the information please to a developer ?
Regards
Hi @guil182,
Thanks for your feedback.
Can you try to create a PR: https://github.com/PrestaShop/PrestaShop with your correction.
https://devdocs.prestashop.com/1.7/contribute/contribution-guidelines/
Thanks!
Hi @khouloudbelguith,
It's the first time I done it. I hope it's ok.
https://github.com/PrestaShop/PrestaShop/pull/20720
Regards