title: How can i force visitors in woocommerce to login before they can access my shop?
body: <p>The below code does not work. It works only for the cart and the checkout for some reason. My guess is that is_shop returns false. I tried to hook it to template_redirect but again is not working properly. Help?</p>
  
  <pre><code>function woo_login_redirect() {
  if (
  ! is_user_logged_in()
  &amp;&amp; (is_woocommerce() || is_shop() || is_cart() || is_checkout())
  ) {
  wp_redirect( '/ο-λογαριασμός-μου/' );
  exit;
  }
  }
  add_action('template_redirect', 'woo_login_redirect');
  </code></pre>