title: Redirect WooCommerce pages to My Account page if not logged in (Issue)
body: <p>In WooCommerce I am redirecting non logged users to <strong>My Account</strong> page when they visit any WooCommerce page. But after user login (in My Account page) when I try to visit that same woocommerce page it's redirect me to <strong>My Account</strong> page. <br>
  But when I visit any other WooCommerce pages its working perfect.</p>
  <p>I am using this code for this purpose:</p>
  <pre><code>&lt;?php
      if ( !is_user_logged_in() ) {
          if(is_woocommerce() || is_shop() || is_cart() || is_checkout())  {
    
              wp_redirect( get_permalink( get_option('woocommerce_myaccount_page_id')) );
              exit();
          }
      }
  ?&gt;
  </code></pre>
  <p>I think the problem is that it stores something in cache or another redirection issue, so when user visit same url it's redirected to <strong>My Account</strong> when is logged in.</p>
  <p>How can I solve this problem?</p>