WPIntell

Source evidence

Filter coupons in guest cart

Power Coupons for WooCommerce · support · 2026-03-14T09:30:00+00:00

mixedsentiment
highseverity
0.82relevance
9replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

3 / 13 rows with source links

23.1% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

10 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
pvnanini resolved
Hello I’m testing the plugin in the shop cart and I see if the guest chekout is activate then all the coupons are shown to the customers, also the ones that generates the cart abandonement plugin. This situation complicates the cart process because the customers begin to try every coupon they see and don’t finish the order. So I would like to ask if there is any filter that I can use to restict what copuons are display in the gest checkout? Many thanks for your help! Hi @pvnanini , This feature is now available in the latest update. We just released it a couple of hours ago. You can check the Changelog . Please update your plugin and you will see the feature. If it works well for you, please mark this thread as Resolved . Kind regards, Herman 😊 Hello Hernan Many thanks for your reply and the new features you are working on. I’ve update the plugin and tried with this snnipet but the filter is not working on in my guest cart, it continues displaying all the coupons avaible add_filter('power_coupons_available_coupons', 'filter_specific_coupons_only', 10, 1); function filter_specific_coupons_only($coupons) { // Define the coupon codes you want to show $allowed_codes = array('coupon1', 'coupon2'); // Filter the coupons to include only those with matching codes $filtered_coupons = array_filter($coupons, function($coupon) use ($allowed_codes) { return in_array($coupon->code, $allowed_codes); }); return array_values($filtered_coupons); } Let me know, many thanks Kind regards Hi @pvnanini , Actually, there’s an option to hide a coupon from the slideout [ screenshot ], however it will also hide the coupon even for a logged-in user. So, what you would like to achieve is coupons will not show up on the slideout for the logged-out users, i.e. when the guest checkout is enabled. Am I understanding your correctly? Kind regards, Herman 😊 Hello Hernan I’m mainly using the guest checkout and I need to display only certain coupons this users, for instance ‘coupon1’, ‘coupon2’ I saw the new option to hide a coupon from the slideout but it could not solve my problem because also I’m working with the cart abandonement plugin that generate automatically coupons, so the slideout has a bunch of random coupons that confuse the customers. So what I would like to achive is to show up only certain coupns on the slideout for guest users, the ones that I define in the filter Kind regards, Hi @pvnanini , sorry for the delay. In your snippet, you tried to fetch coupon code as object $coupon->code however, we are passing array values, hence the code should look something like this: $coupon['code'] Could you please try and see if it works? Kind regards, Herman 😊 Hello Hernan thanks for your reply I tryed this other code fetching with array access but also is doesn’t work, is not filtering only the two allowed codes on the cart page. Could you try it at your end? add_filter('power_coupons_available_coupons', 'filter_specific_coupons_only', 10, 1); function filter_specific_coupons_only($coupons) { // Define the coupon codes you want to show $allowed_codes = array('summer2026', 'zmx53a48'); // Filter the coupons to include only those with matching codes $filtered_coupons = array_filter($coupons, function($coupon) use ($allowed_codes) { return in_array($coupon['code'], $allowed_codes); }); return array_values($filtered_coupons); // Re-index array } Hi @pvnanini , Your snippet above is working for me. Please refer to this video: https://d.pr/v/22597t Please let me know if I miss something. Kind regards, Herman 😊 Great it’s working also here! Many thanks for your help and these new plugin Hi @pvnanini , Great to hear it’s working on your end too! Please start a new thread if you need any assistance regarding Power Coupons. Also, if you like the plugin, please consider leaving a review. Kind regards, Herman 😊

Comments

9 shown
Herman Asrori (BSF) 2026-03-16T08:42:00+00:00

Hi @pvnanini , This feature is now available in the latest update. We just released it a couple of hours ago. You can check the Changelog . Please update your plugin and you will see the feature. If it works well for you, please mark this thread as Resolved . Kind regards, Herman 😊

pvnanini 2026-03-16T19:21:00+00:00

Hello Hernan Many thanks for your reply and the new features you are working on. I’ve update the plugin and tried with this snnipet but the filter is not working on in my guest cart, it continues displaying all the coupons avaible add_filter('power_coupons_available_coupons', 'filter_specific_coupons_only', 10, 1); function filter_specific_coupons_only($coupons) { // Define the coupon codes you want to show $allowed_codes = array('coupon1', 'coupon2'); // Filter the coupons to include only those with matching codes $filtered_coupons = array_filter($coupons, function($coupon) use ($allowed_codes) { return in_array($coupon->code, $allowed_codes); }); return array_values($filtered_coupons); } Let me know, many thanks Kind regards

Herman Asrori (BSF) 2026-03-19T16:34:00+00:00

Hi @pvnanini , Actually, there’s an option to hide a coupon from the slideout [ screenshot ], however it will also hide the coupon even for a logged-in user. So, what you would like to achieve is coupons will not show up on the slideout for the logged-out users, i.e. when the guest checkout is enabled. Am I understanding your correctly? Kind regards, Herman 😊

pvnanini 2026-03-19T19:36:00+00:00

Hello Hernan I’m mainly using the guest checkout and I need to display only certain coupons this users, for instance ‘coupon1’, ‘coupon2’ I saw the new option to hide a coupon from the slideout but it could not solve my problem because also I’m working with the cart abandonement plugin that generate automatically coupons, so the slideout has a bunch of random coupons that confuse the customers. So what I would like to achive is to show up only certain coupns on the slideout for guest users, the ones that I define in the filter Kind regards,

Herman Asrori (BSF) 2026-04-01T17:00:00+00:00

Hi @pvnanini , sorry for the delay. In your snippet, you tried to fetch coupon code as object $coupon->code however, we are passing array values, hence the code should look something like this: $coupon['code'] Could you please try and see if it works? Kind regards, Herman 😊

pvnanini 2026-04-02T15:42:00+00:00

Hello Hernan thanks for your reply I tryed this other code fetching with array access but also is doesn’t work, is not filtering only the two allowed codes on the cart page. Could you try it at your end? add_filter('power_coupons_available_coupons', 'filter_specific_coupons_only', 10, 1); function filter_specific_coupons_only($coupons) { // Define the coupon codes you want to show $allowed_codes = array('summer2026', 'zmx53a48'); // Filter the coupons to include only those with matching codes $filtered_coupons = array_filter($coupons, function($coupon) use ($allowed_codes) { return in_array($coupon['code'], $allowed_codes); }); return array_values($filtered_coupons); // Re-index array }

Herman Asrori (BSF) 2026-04-06T14:58:00+00:00

Hi @pvnanini , Your snippet above is working for me. Please refer to this video: https://d.pr/v/22597t Please let me know if I miss something. Kind regards, Herman 😊

pvnanini 2026-04-06T19:35:00+00:00

Great it’s working also here! Many thanks for your help and these new plugin

Herman Asrori (BSF) 2026-04-07T12:19:00+00:00

Hi @pvnanini , Great to hear it’s working on your end too! Please start a new thread if you need any assistance regarding Power Coupons. Also, if you like the plugin, please consider leaving a review. Kind regards, Herman 😊