If you are using Woocommerce Subscription Plugin and you want to disable the plugin for the users who have Woocommerce subscriptions.
By default, this method is not implemented with our plugin but you can extend the plugin if you have programming knowledge.
If you don’t have programming knowledge also, You can implement this.
Method #1:
- Go to the WordPress Dashboard
- Go to the Appearance tab
- Go to the Theme File Editor
- You can see the image as below
- Open functions.php file
- At the end of the functions.php file, Place the below code.
/**
* Disable the Adblock Popup which have woocommerce subscriptions
*/
if( class_exists( "\CHPADB_PRO\ChpAdbBlockPro" ) && class_exists( "WC_Subscriptions" ) ){
add_filter("adbpro/condition/check", function($block){
if( $block ) return $block;
if( is_user_logged_in( ) ){
$user_id = get_current_user_id( );
if( function_exists( "wcs_user_has_subscription" ) ){
if( wcs_user_has_subscription( $user_id, "", "active" ) ){
return true;
}
}
}
return $block;
}, 15, 1);
}
Now, Every user with a Woocommerce subscription, will not see any Adblock Popup.
Method #2:
- Go to the https://chpadblock.com/extension/woocommerce-subscription/
- Download the plugin
- You can download the plugin only if you have CHP Ads Block Detector Premium Plan.
- Install the plugin
- Activate the plugin
Both methods will work the same.