Thursday, December 30, 2010

Customizing Onepage Checkout - Remove login - Magento

Q. How to remove login block from OnepageCheckout? Every customer checkout as guest.


1.) /app/design/frontend/default/detault/layout/checkout.xml 
 Comment out or remove the reference to “checkout.onepage.login” addLink under the checkout_onepage_index section.




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

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

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





No comments:

Post a Comment