Ever had a store where you don’t want to let your users purchase the same item twice?
There are a few use-cases where this might be true, but whatever the root cause, if you have registered users on your WordPress and WooCommerce store, and it would be helpful for you to prevent customers from re-buying something they already purchased before, the snippet below might help you to get this done.
Please note you may want to add extra to this, like locking it to a product category or tag or specific product IDs. All of these features would be custom code which you’d want to ask a developer about (contact us or post a task onto Codeable!).
But if you just want to not allow any registered user from purchasing the same item twice, the below added to a functions.php file, or custom plugin, will get this done for you!
How to allow users only to purchase items once
This snippet should be added into your functions.php file, or even better, a plugin which contains such snippets, or perhaps a custom plugin.
Leave a comment if this helped you!