- Lunar version: 1.5.0-beta.6
- Laravel Version: 12.62.0
- PHP Version: 8.4.22
- Database Driver & Version: MariaDB 10.11.18
Expected Behaviour:
The Unit Quantity field on the Inventory tab should not accept values lower than 1.
The field should have a minimum value validation of 1, preventing invalid inventory configurations that can cause division by zero errors.
Actual Behaviour:
The Unit Quantity field currently accepts 0.
When In Stock is set to a value greater than 0 and Unit Quantity is set to 0, attempting to add the product or product variant to the cart results in the following error:
DivisionByZeroError
Division by zero
Steps To Reproduce:
- Open a product or product variant in the Lunar admin panel.
- Navigate to the Inventory tab.
- Set In Stock to a value greater than 0.
- Set Unit Quantity to 0.
- Save the changes.
- Attempt to add the product or product variant to the cart.
- Observe that a DivisionByZeroError is thrown.
Expected Behaviour:
The Unit Quantity field on the Inventory tab should not accept values lower than
1.The field should have a minimum value validation of
1, preventing invalid inventory configurations that can cause division by zero errors.Actual Behaviour:
The Unit Quantity field currently accepts
0.When In Stock is set to a value greater than
0and Unit Quantity is set to0, attempting to add the product or product variant to the cart results in the following error:Steps To Reproduce: