Required Products Coupons for WooCommerce
Restrict the usage of WooCommerce coupons unless required products are in the cart.
Install in
This plugin allows you to restrict the usage of WooCommerce coupons unless specific products or variations are in the cart.
You can specify which products are required for a coupon to be valid, providing more control over your discount strategies.
Features
- Restrict coupon usage based on all required products (including variations) being in the cart.
- Customize the error message via a filter.
Filters
runthings_wc_coupons_required_products_missing_products
This filter allows third-party plugins to alter the missing required products before the coupon is rejected.
For detailed documentation and advanced examples, see the full documentation on GitHub.
Parameters:
$missing_products(array): The missing products in the cart, in the format[product_id => quantity].$coupon(WC_Coupon): The coupon object being validated.$required_products(array): The required products for the coupon, in the format[product_id => quantity].$cart_products(array): Products found in the cart, in the format[product_id => quantity].$cart(WC_Cart): The cart instance.
runthings_wc_coupons_required_products_error_message
This filter allows customization of the error message shown when a coupon is not valid due to missing required products.
For detailed documentation and advanced examples, see the full documentation on GitHub.
Parameters:
$message(string): The default error message, e.g.,"This coupon requires specific products in the cart.".$coupon(WC_Coupon): The coupon object being validated.$required_products(array): The required products for the coupon, in the format[product_id => quantity].$missing_products(array): The missing products in the cart, in the format[product_id => quantity].
License
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses/gpl-3.0.html.
Icon – Discount by Gregor Cresnar, from Noun Project, https://thenounproject.com/browse/icons/term/discount/ (CC BY 3.0)
Icon – restriction by Puspito, from Noun Project, https://thenounproject.com/browse/icons/term/restriction/ (CC BY 3.0)
Written by Joobi from the project's own listing. See the source page
1.3.2 – 30th November 2026
- Update WordPress tested up to metadata to 7.2.
1.3.1 – 16th November 2026
- Update WordPress tested up to metadata to 7.1.
- Synchronize the plugin version constant with the release version.
1.3.0 – 11th February 2026
- Add
runthings_wc_coupons_required_products_missing_productsfilter for custom required-product validation. - Document variation support and the new filter.
- Fix required product checks to support product variations.
1.2.2 – 6th January 2026
- Fixed missing “And” separator in the coupon usage restriction panel to match WooCommerce core styling.
- Move plugin directory assets to .wordpress-org/ folder.
- Bump WordPress tested up to field to support 6.9 branch.
1.2.1 – 24th June 2025
- Bump WordPress tested up to field to support 6.8 branch.
1.2.0 – 6th March 2025
- Fixed a bug which caused a valid voucher to fail to verify.
1.1.0 – 7th February 2025
- Incorporate amends requested for WordPress plugin directory submission.
- Filter
runthings_wc_coupons_required_products_error_messageto customize error message. - Filter
runthings_wc_coupon_required_products_error_messagedeprecated.
1.0.0 – 29th January 2025
- Initial release.
- Restrict coupons by required products.
- Filter
runthings_wc_coupon_required_products_error_messageto customize error message.
Follow this listing's changes (Atom feed)