Customizing Onepage Checkout - Remove login

Last modified by seansan on Sat, July 3, 2010 15:21
Source|Old Revisions  

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.

  1. <!-- <block type="checkout/onepage_login" name="checkout.onepage.login" as="login" template="checkout/onepage/login.phtml"/> -->

METHOD 2: Create local.xml

  1. <?xml version="1.0"?>
  2. <layout version="0.1.0">
  3. <checkout_onepage_index>
  4.       <reference name="content">
  5.              <! -- Complete process of removing steps is defined here: http://www.magentocommerce.com/wiki/5_-_modules_and_development/checkout/customizing_onepage_checkout_-_remove_shipping_method -->
  6.             <remove name="checkout.onepage.login"/>
  7.       </reference>
  8. </checkout_onepage_index>
  9. </layout>

2.) /app/design/frontend/default/default/template/checkout/onepage.phtml

Edit the code at the bottom (see line 2 line 19):

  1. <!-- ADD THIS NEXT LINE!!! -->
  2. <input type="hidden" name="checkout_method" id="login:guest" checked="checked" value="guest"/>
  3.  
  4. <script type="text/javascript">
  5. //<![CDATA[
  6.     var accordion = new Accordion('checkoutSteps', '.head', true);
  7.     <?php if($this->getActiveStep()): ?>
  8.     accordion.openSection('opc-billing');
  9.     <?php endif ?>
  10.  
  11.     var checkout = new Checkout(accordion,{
  12.         progress: '<?php echo $this->getUrl('checkout/onepage/progress') ?>',
  13.         review: '<?php echo $this->getUrl('checkout/onepage/review') ?>',
  14.         saveMethod: '<?php echo $this->getUrl('checkout/onepage/saveMethod') ?>',
  15.         failure: '<?php echo $this->getUrl('checkout/cart') ?>'}
  16.     );
  17.  
  18.     // Go to the next method on start (it will look for the input we added above)
  19.     //IE fix
  20.     var cb = $("login:guest");
  21.     cb.checked = true;
  22.  
  23.     checkout.setMethod();  // MAKE SURE TO ADD THIS LINE!!!
  24. //]]>
  25. </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




 

Magento 2 GitHub Repository

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs