Customizing Onepage Checkout - Remove login
Look at the Old Revisions to see a version, which is working with Magento 1.1.X and Internet Explorer (6, 7 and 8)!
21/4/09 - Added fix for Internet Explorer
How to remove login block from OnepageCheckout. Every customer checkout as guest.
This is working with Magento 1.2.1 in Firefox, but not in Internet Explorer!
1.) /app/design/frontend/default/detault/layout/checkout.xml
METHOD 1: Comment out or remove the reference to “checkout.onepage.login” addLink under the checkout_onepage_index section.
- <!-- <block type="checkout/onepage_login" name="checkout.onepage.login" as="login" template="checkout/onepage/login.phtml"/> -->
METHOD 2: Create local.xml
- <?xml version="1.0"?>
- <layout version="0.1.0">
- <checkout_onepage_index>
- <reference name="content">
- <! -- Complete process of removing steps is defined here: http://www.magentocommerce.com/wiki/5_-_modules_and_development/checkout/customizing_onepage_checkout_-_remove_shipping_method -->
- <remove name="checkout.onepage.login"/>
- </reference>
- </checkout_onepage_index>
- </layout>
2.) /app/design/frontend/default/default/template/checkout/onepage.phtml
Edit the code at the bottom (see line 2 line 19):
- <!-- ADD THIS NEXT LINE!!! -->
- <input type="hidden" name="checkout_method" id="login:guest" checked="checked" value="guest"/>
- <script type="text/javascript">
- //<![CDATA[
- var accordion = new Accordion('checkoutSteps', '.head', true);
- <?php if($this->getActiveStep()): ?>
- accordion.openSection('opc-billing');
- <?php endif ?>
- var checkout = new Checkout(accordion,{
- progress: '<?php echo $this->getUrl('checkout/onepage/progress') ?>',
- review: '<?php echo $this->getUrl('checkout/onepage/review') ?>',
- saveMethod: '<?php echo $this->getUrl('checkout/onepage/saveMethod') ?>',
- failure: '<?php echo $this->getUrl('checkout/cart') ?>'}
- );
- // Go to the next method on start (it will look for the input we added above)
- //IE fix
- var cb = $("login:guest");
- cb.checked = true;
- checkout.setMethod(); // MAKE SURE TO ADD THIS LINE!!!
- //]]>
- </script>
The checkout.setMethod() will move to the next checkout method (billing) if it sees that the input for a guest is checked (hence why we add the hidden input)Code Text


