title: Magento - 'proceed to checkout' button to go to login page if not logged in
body: <p>When a user who is not logged in (anonymous) clicks <code>Proceed to checkout</code>, I want them the be taken to the <strong>login page</strong>. Then, after they've logged in or registered, they should be taken back to the <strong>checkout page</strong>.</p>
  
  <p>I'm using onepage checkout, which has a login section you're not logged in, but <em>the powers that be</em> don't want this.</p>
  
  <p>Initially, I started down the route of changing <code>checkout.xml</code> to have these values:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;customer_logged_in&gt;
  
      &lt;block type="core/text_list" name="checkout.cart.top_methods" as="top_methods" translate="label"&gt;
          &lt;label&gt;Payment Methods Before Checkout Button&lt;/label&gt;
          &lt;block type="checkout/onepage_link" name="checkout.cart.methods.onepage" template="checkout/onepage/link.phtml"/&gt;
      &lt;/block&gt;
  
  &lt;/customer_logged_in&gt;
  
  &lt;customer_logged_out&gt;
  
      &lt;block type="core/text_list" name="checkout.cart.top_methods" as="top_methods" translate="label"&gt;
          &lt;label&gt;Payment Methods Before Checkout Button&lt;/label&gt;
          &lt;block type="checkout/onepage_link_not_logged_in" name="checkout.cart.methods.onepage" template="checkout/onepage/link_not_logged_in.phtml"/&gt;
      &lt;/block&gt;
  
  &lt;/customer_logged_out&gt;
  </code></pre>
  
  <p>And <code>link_not_logged_in.phtml</code>:</p>
  
  <pre class="lang-php prettyprint-override"><code>$this-&gt;getLoginUrl();
  </code></pre>
  
  <p>but this did not even pull my new phtml file, and I'm not even sure this would take me to the checkout page after. Any articles or help greatly receieved.</p>