olegnn / react-shopping-cart

Powerful shopping cart
MIT License
130 stars 41 forks source link

min & max limit on quantity of prodcut. #4

Open w-abdullah opened 6 years ago

w-abdullah commented 6 years ago

Hey, we are using this awesome package and it working great. Thank you for developing this.

Just want to confirm that is there any way we can set limits on quantity of a product somehow?

Like we have only 5 products in store so user shouldn't be allowed to add more than 5.

olegnn commented 6 years ago

Hello,

For now, there's no possibility to somehow limit the amount of product in "Add to cart" form but you can write your own reducer for products (or rewrite part of https://github.com/olegnn/react-shopping-cart/blob/master/src/reducers/cart/products.js) to restrict the maximum count of product.