Prestashop: Message "There are not enough products in stock" Prestashop 1.7.5.0

Created on 19 Feb 2019  路  7Comments  路  Source: PrestaShop/PrestaShop

Hello, I think that in file ... \ src \ Adapter \ Presenter \ Product \ ProductLazyArray.php in line 766:

elseif ($ product ['quantity_wanted']> 0 && $ product ['quantity']> = 0)

was one Bug done. This condition always becomes true if $ product ['quantity'] = 0 because the desired amount always starts with 1. Due to this error, the message "There are not enough products in stock" always appears, regardless of whether the required quantity is not available or the item is not in stock.

I think this line must look like this:
elseif ($ product ['quantity_wanted']> 1 && $ product ['quantity']> = 0)

1.7.4.4 1.7.5.0 1.7.5.1 Bug FO Fixed Minor Product settings

All 7 comments

Hi @viktor-abc,

Could you please provide me steps to reproduce the issue in a new comment.
Thanks!

Hello, I have added 2 pictures that I think are self-explanatory.
out_of_stock_1
out_of_stock_2

Hi @viktor-abc,

Thanks for these clarifications.
I manage to reproduce the issue with PS1.7.5.0 & PS1.7.5.1 & PS1.7.4.4.
Would you be willing to make a pull request on GitHub with your code suggestion?
https://github.com/PrestaShop/PrestaShop/tree/develop
Thank you!

I can confirm the bug on my installation of PS1.7.5.1 and the fix works fine! Well done @viktor-abc !

Hi,
@khouloudbelguith , this issue doesn't exist on develop branch. Can close it be?
Thanks

Hi @ntiepresta,

Yes, I did not manage to reproduce the issue with develop branch.
https://drive.google.com/file/d/1ldXUoTox8Ixko7foCQs_sIJ3SCN3wWX0/view
Since it is fixed in the next release PS1.7.6.0, I will close the issue.
Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marionf picture marionf  路  3Comments

wikao2 picture wikao2  路  3Comments

nrcjea001 picture nrcjea001  路  3Comments

sandra2n picture sandra2n  路  3Comments

PrestaShark picture PrestaShark  路  3Comments