Magento Onestep Checkout – Remove Login Step

In this blog post, we are going to see how to remove the first step from checkout page.

The basics idea of removing any step from checkout is
1. Change javascript and HTML to remove the step display
2. Set default values in Quote object for the step removed, so that checkout process goes smoothly.
If we need to remove the login step there are 3 different ways.
1. Checkout will be done only as guest
2. Checkout will be done only for registered users
3. Checkout will only be available for logged in users.
Now lets go into detail on how to remove the login step. First i have created a module for this called Excellence_Remove for this blog. Attached is source code of module to remove step1.

Step1: Onepage Block

First we need to override the Onepage.php block, so that we can change the steps array. So to override the block Mage_Checkout_Block_Onepage open your module’s config.xml file and put inside the blocks tag, below code


So the core block Mage_Checkout_Block_Onepage has been overridden by Excellence_Remove_Block_Onepage block. In the code in this block is

class Excellence_Remove_Block_Onepage extends Mage_Checkout_Block_Onepage
	public function getSteps()
		$steps = array();

		if (!$this->isCustomerLoggedIn()) {
			//$steps['login'] = $this->getCheckout()->getStepData('login');

		$stepCodes = array('billing', 'shipping', 'shipping_method', 'payment', 'review');

		foreach ($stepCodes as $step) {
			$steps[$step] = $this->getCheckout()->getStepData($step);
		return $steps;

	public function getActiveStep()
		//return $this->isCustomerLoggedIn() ? 'billing' : 'login';
		return $this->isCustomerLoggedIn() ? 'billing' : 'billing';

So here as we can see i have removed the ‘login’ step from the $stepCodes array and also made the ‘billing’ step the default active step.

Step2: PHTML and Javascript

Here basically, we need to change the login step javascript, so we need to add our javascript file. So we add our javascript file in onepage.phtml

<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/removecheckout.js') ?>"></script>

and now the code of our javascript file would be

var Excellence = Class.create(Checkout, {
	initialize: function($super,accordion, urls){
		$super(accordion, urls);
		//New Code Addded
		this.steps = ['billing', 'shipping', 'shipping_method', 'payment', 'review'];
	setMethodGuest: function(){
	setMethodRegister: function(){'register-customer-password');

Here we have created to function setMethodGuest and setMethodRegister. These functions will be called in onepage.phtml file depending on the type of our checkout. So in the onepage.phtml file this is the changes we will make

<script type="text/javascript">
    var accordion = new Accordion('checkoutSteps', '.step-title', true);
    <?php if($this->getActiveStep()): ?>
    accordion.openSection('opc-<?php echo $this->getActiveStep() ?>');
    <?php endif ?>
    //New Code Added Below
    var checkout = new Excellence(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') ?>'}
    //If Guest Method Checkout
    //If Register Method Checkout,uncomment code below

For the full code please check the moduel.

Step3: Checkout Onepage Controller

Next we need to change the onepage controller, so that we can set default checkout method in the indexAction. Here is the code to add

public function indexAction()
		if (!Mage::helper('checkout')->canOnepageCheckout()) {
			Mage::getSingleton('checkout/session')->addError($this->__('The onepage checkout is disabled.'));
		$quote = $this->getOnepage()->getQuote();
		if (!$quote->hasItems() || $quote->getHasError()) {
		if (!$quote->validateMinimumAmount()) {
			$error = Mage::getStoreConfig('sales/minimum_order/error_message');

		Mage::getSingleton('customer/session')->setBeforeAuthUrl(Mage::getUrl('*/*/*', array('_secure'=>true)));

		//If you want guest checkout by default
		$method = Mage_Checkout_Model_Type_Onepage::METHOD_GUEST;
		//If you want register checkout by default, uncomment code below
		 $method = Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER;

		//If you want only logged in users to be able to checkout, uncomment code below
			$method = Mage_Checkout_Model_Type_Onepage::METHOD_CUSTOMER;


This is all that is required to remove the login step. In the module code, all the 3 types of checkout have been you need to comment and uncomment in the files OnepageController.php and onepage.phtml