title: WooCommerce check and redirect to login before checkout
body: <p>The default Woocommerce checkout behavior breaks a lot of web conventions by showing the &quot;Create Account&quot; boxes on the checkout page if it detects the user is not logged in. New users may not know what to do without any added instructions.</p>
  <p>My desired sequence would be:</p>
  <p>User Checkout &gt; Check login &gt;</p>
  <ul>
  <li>Proceed to checkout if logged in.</li>
  <li>Redirect to login/register page if not logged in &gt; proceed to the checkout page.</li>
  </ul>
  <p>This is EXACTLY the case in <a href="https://stackoverflow.com/questions/39355976/woocommerce-login-redirect-based-on-cart">WooCommerce login redirect based on cart</a></p>
  <p>However, what I feel uncomfortable is that, in the above case, once the user logged in, he/she will be redirected to the checkout page if the cart is not empty. If the user's cart is not empty, he/she will not be able to go to MyAccount at all even though he/she does not want to checkout yet.</p>
  <p>Any idea on this one?</p>