{"id":221280,"date":"2025-02-22T16:52:57","date_gmt":"2025-02-22T16:52:57","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/coupons-required-products-for-woocommerce\/"},"modified":"2026-02-11T20:08:25","modified_gmt":"2026-02-11T20:08:25","slug":"runthings-wc-coupons-required-products","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/runthings-wc-coupons-required-products\/","author":20973379,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.3.0","stable_tag":"1.3.0","tested":"6.9.4","requires":"6.4","requires_php":"8.0","requires_plugins":null,"header_name":"Required Products Coupons for WooCommerce","header_author":"runthingsdev","header_description":"Restrict the usage of coupons unless required products are in the cart.","assets_banners_color":"f3d7c5","last_updated":"2026-02-11 20:08:25","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/runthings.dev\/wordpress-plugins\/wc-coupons-required-products\/","header_author_uri":"https:\/\/runthings.dev\/","rating":0,"author_block_rating":0,"active_installs":0,"downloads":525,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.1.0":{"tag":"1.1.0","author":"runthingsdev","date":"2025-02-22 16:57:32"},"1.2.0":{"tag":"1.2.0","author":"runthingsdev","date":"2025-03-06 15:08:19"},"1.2.1":{"tag":"1.2.1","author":"runthingsdev","date":"2025-06-24 21:22:51"},"1.2.2":{"tag":"1.2.2","author":"runthingsdev","date":"2026-01-07 12:49:16"},"1.3.0":{"tag":"1.3.0","author":"runthingsdev","date":"2026-02-11 20:08:25"}},"upgrade_notice":{"1.3.0":"<p>Adds a new filter for custom required-product validation and improves variation handling.<\/p>","1.2.2":"<p>Fixed missing &quot;And&quot; separator in the coupon usage restriction panel to match WooCommerce core styling.<\/p>","1.2.1":"<p>Bump WordPress tested up to field to support 6.8 branch.<\/p>"},"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3244950,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3244950,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3244950,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3244950,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.1.0","1.2.0","1.2.1","1.2.2","1.3.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3434350,"resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3434350,"resolution":"2","location":"assets","locale":""},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3434350,"resolution":"3","location":"assets","locale":""}},"screenshots":{"1":"Coupon settings page with required products fields.","2":"Example denied coupon usage due to missing required products.","3":"Example denied coupon usage due to missing required products, with custom message."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[591,331,238635,286],"plugin_category":[45],"plugin_contributors":[228895],"plugin_business_model":[],"class_list":["post-221280","plugin","type-plugin","status-publish","hentry","plugin_tags-coupons","plugin_tags-discount","plugin_tags-required-products","plugin_tags-woocommerce","plugin_category-ecommerce","plugin_contributors-runthingsdev","plugin_committers-runthingsdev","plugin_support_reps-rtpharry"],"banners":{"banner":"https:\/\/ps.w.org\/runthings-wc-coupons-required-products\/assets\/banner-772x250.png?rev=3244950","banner_2x":"https:\/\/ps.w.org\/runthings-wc-coupons-required-products\/assets\/banner-1544x500.png?rev=3244950","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/runthings-wc-coupons-required-products\/assets\/icon-128x128.png?rev=3244950","icon_2x":"https:\/\/ps.w.org\/runthings-wc-coupons-required-products\/assets\/icon-256x256.png?rev=3244950","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/runthings-wc-coupons-required-products\/assets\/screenshot-1.png?rev=3434350","caption":"Coupon settings page with required products fields."},{"src":"https:\/\/ps.w.org\/runthings-wc-coupons-required-products\/assets\/screenshot-2.png?rev=3434350","caption":"Example denied coupon usage due to missing required products."},{"src":"https:\/\/ps.w.org\/runthings-wc-coupons-required-products\/assets\/screenshot-3.png?rev=3434350","caption":"Example denied coupon usage due to missing required products, with custom message."}],"raw_content":"<!--section=description-->\n<p>This plugin allows you to restrict the usage of WooCommerce coupons unless specific products or variations are in the cart.<\/p>\n\n<p>You can specify which products are required for a coupon to be valid, providing more control over your discount strategies.<\/p>\n\n<h4>Features<\/h4>\n\n<ul>\n<li>Restrict coupon usage based on all required products (including variations) being in the cart.<\/li>\n<li>Customize the error message via a filter.<\/li>\n<\/ul>\n\n<h3>Filters<\/h3>\n\n<h4>runthings_wc_coupons_required_products_missing_products<\/h4>\n\n<p>This filter allows third-party plugins to alter the missing required products before the coupon is rejected.<\/p>\n\n<p>For detailed documentation and advanced examples, see the <a href=\"https:\/\/github.com\/runthings-dev\/runthings-wc-coupons-required-products#filters\">full documentation on GitHub<\/a>.<\/p>\n\nParameters:\n\n<ol>\n<li><strong><code>$missing_products<\/code><\/strong> (<code>array<\/code>): The missing products in the cart, in the format <code>[product_id =&gt; quantity]<\/code>.<\/li>\n<li><strong><code>$coupon<\/code><\/strong> (<code>WC_Coupon<\/code>): The coupon object being validated.<\/li>\n<li><strong><code>$required_products<\/code><\/strong> (<code>array<\/code>): The required products for the coupon, in the format <code>[product_id =&gt; quantity]<\/code>.<\/li>\n<li><strong><code>$cart_products<\/code><\/strong> (<code>array<\/code>): Products found in the cart, in the format <code>[product_id =&gt; quantity]<\/code>.<\/li>\n<li><strong><code>$cart<\/code><\/strong> (<code>WC_Cart<\/code>): The cart instance.<\/li>\n<\/ol>\n\n<h4>runthings_wc_coupons_required_products_error_message<\/h4>\n\n<p>This filter allows customization of the error message shown when a coupon is not valid due to missing required products.<\/p>\n\n<p>For detailed documentation and advanced examples, see the <a href=\"https:\/\/github.com\/runthings-dev\/runthings-wc-coupons-required-products#filters\">full documentation on GitHub<\/a>.<\/p>\n\nParameters:\n\n<ol>\n<li><strong><code>$message<\/code><\/strong> (<code>string<\/code>): The default error message, e.g., <code>\"This coupon requires specific products in the cart.\"<\/code>.<\/li>\n<li><strong><code>$coupon<\/code><\/strong> (<code>WC_Coupon<\/code>): The coupon object being validated.<\/li>\n<li><strong><code>$required_products<\/code><\/strong> (<code>array<\/code>): The required products for the coupon, in the format <code>[product_id =&gt; quantity]<\/code>.<\/li>\n<li><strong><code>$missing_products<\/code><\/strong> (<code>array<\/code>): The missing products in the cart, in the format <code>[product_id =&gt; quantity]<\/code>.<\/li>\n<\/ol>\n\n<h3>License<\/h3>\n\n<p>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.<\/p>\n\n<p>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.<\/p>\n\n<p>You should have received a copy of the GNU General Public License along with this program; if not, see <a href=\"http:\/\/www.gnu.org\/licenses\/gpl-3.0.html\">http:\/\/www.gnu.org\/licenses\/gpl-3.0.html<\/a>.<\/p>\n\n<p>Icon - Discount by Gregor Cresnar, from Noun Project, https:\/\/thenounproject.com\/browse\/icons\/term\/discount\/ (CC BY 3.0)<\/p>\n\n<p>Icon - restriction by Puspito, from Noun Project, https:\/\/thenounproject.com\/browse\/icons\/term\/restriction\/ (CC BY 3.0)<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the plugin files to the <code>\/wp-content\/plugins\/runthings-wc-coupons-required-products<\/code> directory, or install the plugin through the WordPress plugins screen directly.<\/li>\n<li>Activate the plugin through the 'Plugins' screen in WordPress.<\/li>\n<li>Go to WooCommerce area of the admin panel, and look under Marketing &gt; Coupons and edit or create a coupon.<\/li>\n<li>In the \"Usage restriction\" tab, you will see the option to select required products for the coupon.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"what%20is%20the%20difference%20between%20the%20built-in%20woocommerce%20%22products%22%20field%20and%20this%20plugin%3F\"><h3>What is the difference between the built-in WooCommerce \"Products\" field and this plugin?<\/h3><\/dt>\n<dd><p>The built-in WooCommerce \"Products\" field allows you to specify products that the coupon can be applied to.<\/p>\n\n<p>This means that the discount will be applied if <em>any<\/em> of the specified products are in the cart.<\/p>\n\n<p>In contrast, this plugin restricts the usage of the coupon unless <em>all<\/em> of the specified products are in the cart.<\/p>\n\n<p>This means that the coupon will not be valid unless every  required product is present in the cart.<\/p><\/dd>\n<dt id=\"how%20do%20i%20restrict%20a%20coupon%20to%20specific%20products%3F\"><h3>How do I restrict a coupon to specific products?<\/h3><\/dt>\n<dd><p>Edit the coupon and go to the \"Usage restriction\" tab.<\/p>\n\n<p>In the \"Required products\" section, select the products that must be in the cart for the coupon to be valid.<\/p><\/dd>\n<dt id=\"can%20i%20use%20this%20plugin%20with%20other%20woocommerce%20coupon%20restrictions%3F\"><h3>Can I use this plugin with other WooCommerce coupon restrictions?<\/h3><\/dt>\n<dd><p>Yes, this plugin works alongside other WooCommerce coupon restrictions such as minimum spend, maximum spend, and role restrictions.<\/p><\/dd>\n<dt id=\"can%20you%20implement%20a%20specific%20variation%20i%20need%20for%20the%20required%20products%3F\"><h3>Can you implement a specific variation I need for the required products?<\/h3><\/dt>\n<dd><p>Specific variations are supported in the required products selector.<\/p>\n\n<p>The plugin has been kept deliberately simple for now, because this met the clients specific needs.<\/p>\n\n<p>There are lots of other combinations of requirements that I can think of like excluding products, involving quantities, requiring x products in a category, etc.<\/p>\n\n<p>If you have a specific requirement, and time allows, I'll try to implement it.<\/p>\n\n<p>Please open an issue on the GitHub repo, over at https:\/\/github.com\/runthings-dev\/runthings-wc-coupons-required-products<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.3.0 - 11th February 2026<\/h4>\n\n<ul>\n<li>Add <code>runthings_wc_coupons_required_products_missing_products<\/code> filter for custom required-product validation.<\/li>\n<li>Document variation support and the new filter.<\/li>\n<li>Fix required product checks to support product variations.<\/li>\n<\/ul>\n\n<h4>1.2.2 - 6th January 2026<\/h4>\n\n<ul>\n<li>Fixed missing \"And\" separator in the coupon usage restriction panel to match WooCommerce core styling.<\/li>\n<li>Move plugin directory assets to .wordpress-org\/ folder.<\/li>\n<li>Bump WordPress tested up to field to support 6.9 branch.<\/li>\n<\/ul>\n\n<h4>1.2.1 - 24th June 2025<\/h4>\n\n<ul>\n<li>Bump WordPress tested up to field to support 6.8 branch.<\/li>\n<\/ul>\n\n<h4>1.2.0 - 6th March 2025<\/h4>\n\n<ul>\n<li>Fixed a bug which caused a valid voucher to fail to verify.<\/li>\n<\/ul>\n\n<h4>1.1.0 - 7th February 2025<\/h4>\n\n<ul>\n<li>Incorporate amends requested for WordPress plugin directory submission.<\/li>\n<li>Filter <code>runthings_wc_coupons_required_products_error_message<\/code> to customize error message.<\/li>\n<li>Filter <code>runthings_wc_coupon_required_products_error_message<\/code> deprecated.<\/li>\n<\/ul>\n\n<h4>1.0.0 - 29th January 2025<\/h4>\n\n<ul>\n<li>Initial release.<\/li>\n<li>Restrict coupons by required products.<\/li>\n<li>Filter <code>runthings_wc_coupon_required_products_error_message<\/code> to customize error message.<\/li>\n<\/ul>","raw_excerpt":"Restrict the usage of WooCommerce coupons unless required products are in the cart.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/221280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=221280"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/runthingsdev"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=221280"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=221280"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=221280"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=221280"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=221280"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=221280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}