craftpeak / woocommerce-prevent-repeat-purchases
A WooCommerce plugin to prevent customers from purchasing products more than once. Only works with Simple products.
Installs: 1 255
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 11
Forks: 0
Open Issues: 1
Type:wordpress-plugin
This package is not auto-updated.
Last update: 2025-04-15 14:38:36 UTC
README
A WooCommerce plugin to prevent customers from purchasing products more than once.
This only works with Simple products!!
Requirements
- WooCommerce
- PHP 7+ (not actually, but don't be that person)
Installation
composer require craftpeak/woocommerce-prevent-repeat-purchases
(or do it the old fashioned way)
Setup
For Simple products, there is a "Prevent Repeat Purchases?" checkbox in the "General" product metabox. If checked,
customers will only be able to purchase the product once (per account). This works via the wc_customer_bought_product
function, and is set on a product-by-product basis.
Customization
If you would like to change the message showed to users when they can't make a repeat purchase, use the
wc_repeat_nonpurchaseable_message
filter, for example:
add_filter( 'wc_repeat_nonpurchaseable_message', function() { return "Ya can't have it AGAIN!"; } );