Learn in this tutorial how to limit the number of products the user can add to the Easy Digital Downloads (EDD) cart using code.
If you are using Easy Digital Downloads, in some cases you may want to limit the number of items that can be added to the cart.
For example, on a website where only one product or subscription is sold, where it doesn’t make sense to have more than one variation at a time.
Are you interested in having control over this? Here’s how to do it:
Snippet to limit the number of items added to the cart in Easy Digital Downloads
To see this and another 1097 code snippets of this website, login or subscribe here.
It’s as simple as that.
In this case the user will only be able to include one item in the Easy Digital Downloads cart. But if you want to change this limit you can do it by modifying >= 1
by the number you want.
Conclusions
Do you want to limit the number of items that can be added to the Easy Digital Downloads cart? Now you know how to do it easily using code.
If you have any question, please leave it in the comments. And if you want to give me a suggestion for future snippets, please send it through the contact form.
Benefits of being a subscriber. 🙂