Add stock checks throughout the app. Add logic to update cart if there are difference between amounts in cart and available stock.
useInventory Hook
[x] Create function to check Inventory in database to compare with cart.
Product Page
[x] Update logic to get latest stock when reloading per SKU when updating page.
Cart & Checkout Page
[x] Check for stock differences between all items in cart and their respective stock in database. If difference is present, update corresponding items in cart.
Create Order
[x] Update inventory database quantities when creating order.
Tasks
Add stock checks throughout the app. Add logic to update cart if there are difference between amounts in cart and available stock.
useInventory Hook
Product Page
Cart & Checkout Page
Create Order