Prestashop: Possibility to add a quantity greater than the quantity in stock

Created on 20 Mar 2020  路  2Comments  路  Source: PrestaShop/PrestaShop

Describe the bug

In an order view when adding another product to the order it is possible to set a quantity greater than the quantity in stock for this product

Expected behavior

it should not be possible to add more than the quantity in stock

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to BO => orders => orders
  2. Select an order an click on view
  3. On the order view page add a new product to the order and set the quantity to a value greater than the available quantity
  4. See error

Screenshots
https://drive.google.com/file/d/1LYOxmyQFNTTgzAzWugUGTOTAZhp7wKA2/view?usp=sharing

Additional information

Some PR (#18200 , #18168 ) and issue ( #17963 , #17967 , #18031 , #17968 ) are similar/related to this issue. But this issue is about another behavior discoverd while testing them

  • PrestaShop version: 1.7.7
  • PHP version: 7.2
1.7.7.x BO Order migration

Most helpful comment

I still created a PR to improve the check server side and use a more appropriate exception, but this issue can be closed anyway

All 2 comments

@SD1982 so actually the behavor you described is normal Because the product you selected is allowed to be ordered out of stock
I you try the same action with a Mug or example you'll see that the add button is disabled

I still created a PR to improve the check server side and use a more appropriate exception, but this issue can be closed anyway

Was this page helpful?
0 / 5 - 0 ratings