You might be directly using the data, which can make it challenging to manage quantity or stock-related issues.
A better approach would be to create a separate Checkout item and include it in your Cart table.
If the quantity of any item in the cart exceeds the available stock, you can display an error message, preventing the item from being added to the cart.
This method is used by most online shops and avoids blocking the checkout buttkn, which is not very user-friendly.
You may need to reorganize your database structure to implement this.
1 Like