Home / Archive / MemberPress: WooCommerce – Show Protected Products on the Shop Page
Duplicate Snippet

Embed Snippet on Your Site

MemberPress: WooCommerce – Show Protected Products on the Shop Page

If we protect products using Rules, they won’t show in the Shop page. To change this behavior, we can remove these filters: add_filter('woocommerce_product_is_visible', 'MeprRulesCtrl::override_wc_is_visible', 11, 2); and add_filter('woocommerce_variation_is_visible', 'MeprRulesCtrl::override_wc_is_visible', 11, 4);.

Code Preview
php
<?php
function remove_plugin_filter() {
    remove_filter( 'woocommerce_product_is_visible', 'MeprRulesCtrl::override_wc_is_visible', 11, 2);
	remove_filter( 'woocommerce_variation_is_visible', 'MeprRulesCtrl::override_wc_is_visible', 11, 4);
}
add_action( 'plugins_loaded', 'remove_plugin_filter' );

Comments

Add a Comment