WooCommerce: Make WC pages/products private

/* Add to functions.php */ function woo_private() { if (! is_user_logged_in() && ( is_woocommerce() || is_cart() || is_checkout() ) ) { wp_redirect( site_url( '/login-registo' ) ); exit; } } add_action('template_redirect', 'woo_private');

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.