{"id":7763,"date":"2022-10-12T03:47:01","date_gmt":"2022-10-12T03:47:01","guid":{"rendered":"https:\/\/chpadblock.com\/?post_type=docs&#038;p=7763"},"modified":"2022-10-12T05:03:44","modified_gmt":"2022-10-12T05:03:44","slug":"plugin-compatibility-with-woocommerce-subscription","status":"publish","type":"docs","link":"https:\/\/chpadblock.com\/docs\/support\/plugin-compatibility-with-woocommerce-subscription\/","title":{"rendered":"Plugin Compatibility with Woocommerce Subscription"},"content":{"rendered":"\n<p>If you are using Woocommerce Subscription Plugin and you want to disable the plugin for the users who have Woocommerce subscriptions.<\/p>\n\n\n\n<p>By default, this method is not implemented with our plugin but you can extend the plugin if you have programming knowledge.<\/p>\n\n\n\n<p>If you don&#8217;t have programming knowledge also, You can implement this.<\/p>\n\n\n\n<p><strong><span style=\"text-decoration: underline;\">Method #1:<\/span><\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Go to the WordPress Dashboard<\/li><li>Go to the <span style=\"text-decoration: underline;\">Appearance <\/span>tab<\/li><li>Go to the <span style=\"text-decoration: underline;\">Theme File Editor<\/span><\/li><li>You can see the image as below<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/chpadblock.com\/wp-content\/uploads\/2022\/10\/screenshot-chpadblock.com-2022.10.12-09_37_30.png\" alt=\"\" class=\"wp-image-7767\" width=\"770\" height=\"293\" srcset=\"https:\/\/chpadblock.com\/wp-content\/uploads\/2022\/10\/screenshot-chpadblock.com-2022.10.12-09_37_30.png 1635w, https:\/\/chpadblock.com\/wp-content\/uploads\/2022\/10\/screenshot-chpadblock.com-2022.10.12-09_37_30-768x293.png 768w, https:\/\/chpadblock.com\/wp-content\/uploads\/2022\/10\/screenshot-chpadblock.com-2022.10.12-09_37_30-1536x586.png 1536w, https:\/\/chpadblock.com\/wp-content\/uploads\/2022\/10\/screenshot-chpadblock.com-2022.10.12-09_37_30-60x23.png 60w, https:\/\/chpadblock.com\/wp-content\/uploads\/2022\/10\/screenshot-chpadblock.com-2022.10.12-09_37_30-110x42.png 110w, https:\/\/chpadblock.com\/wp-content\/uploads\/2022\/10\/screenshot-chpadblock.com-2022.10.12-09_37_30-600x229.png 600w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Open <span style=\"text-decoration: underline;\">functions.php file<\/span><\/li><li>At the end of the functions.php file, Place the below code.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\r\n * Disable the Adblock Popup which have woocommerce subscriptions\r\n *\/\r\nif( class_exists( \"\\CHPADB_PRO\\ChpAdbBlockPro\" ) &amp;&amp; class_exists( \"WC_Subscriptions\" ) ){\r\n    add_filter(\"adbpro\/condition\/check\", function($block){\r\n        if( $block ) return $block;\r\n    \r\n        if( is_user_logged_in( ) ){\r\n            $user_id = get_current_user_id( );\r\n            if( function_exists( \"wcs_user_has_subscription\" ) ){\r\n                if( wcs_user_has_subscription( $user_id, \"\", \"active\" ) ){\r\n                    return true;\r\n                }\r\n            }\r\n        }\r\n    \r\n        return $block;\r\n    }, 15, 1);\r\n}<\/code><\/pre>\n\n\n\n<p>Now, Every user with a Woocommerce subscription, will not see any Adblock Popup.<\/p>\n\n\n\n<p><strong><span style=\"text-decoration: underline;\">Method #2:<\/span><\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Go to the <a href=\"https:\/\/chpadblock.com\/extension\/woocommerce-subscription\/\">https:\/\/chpadblock.com\/extension\/woocommerce-subscription\/<\/a><\/li><li>Download the plugin<\/li><li>You can download the plugin only if you have CHP Ads Block Detector Premium Plan.<\/li><li>Install the plugin<\/li><li>Activate the plugin<\/li><\/ul>\n\n\n\n<p>Both methods will work the same.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;t have programming knowledge also, You can implement this. Method #1: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"footnotes":""},"doc_category":[27],"doc_tag":[],"knowledge_base":[21],"class_list":["post-7763","docs","type-docs","status-publish","hentry","doc_category-how-to","knowledge_base-support"],"acf":[],"_links":{"self":[{"href":"https:\/\/chpadblock.com\/api\/wp\/v2\/docs\/7763","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chpadblock.com\/api\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/chpadblock.com\/api\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/chpadblock.com\/api\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chpadblock.com\/api\/wp\/v2\/comments?post=7763"}],"version-history":[{"count":4,"href":"https:\/\/chpadblock.com\/api\/wp\/v2\/docs\/7763\/revisions"}],"predecessor-version":[{"id":7778,"href":"https:\/\/chpadblock.com\/api\/wp\/v2\/docs\/7763\/revisions\/7778"}],"wp:attachment":[{"href":"https:\/\/chpadblock.com\/api\/wp\/v2\/media?parent=7763"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/chpadblock.com\/api\/wp\/v2\/doc_category?post=7763"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/chpadblock.com\/api\/wp\/v2\/doc_tag?post=7763"},{"taxonomy":"knowledge_base","embeddable":true,"href":"https:\/\/chpadblock.com\/api\/wp\/v2\/knowledge_base?post=7763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}