bumbummen99 / LaravelShoppingcart

A simple shopping cart implementation for Laravel
MIT License
505 stars 234 forks source link

Limit adding to cart due to the product quantity #122

Closed behzadsp closed 3 years ago

behzadsp commented 3 years ago

is there any way to limit adding products to cart due to the product quantity? for example i have a 5 quantity of a product and i can limit it with add to cart form and user cant add 6 product to cart but when i try to add by 1 i can add it to cart as many as i want.

bumbummen99 commented 3 years ago

You can always check the qty directly before you call add(). I think we could also add a method to the trait / interface to receive the remaining qty using the apps implementation rather of being included in the package itself. I am open for ideas and PRs :)

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days