Bypassing Billing Information(first step) of Checkout Process in Magento!

17 comments
Recently I faced a situation in which I had to remove the first step of one page checkout process in Magento. it was a real brain turner for me because throughout the web I found articles to remove second and third steps of the checkout process but not the first one. And after an immense R&D my friend Vivek Khatri came up with the easiest trick of removing the first step(billing information) from Magento checkout process. Here I am sharing the trick with my readers...



Open the file app\code\core\Mage\Checkout\Block\Onepage.php
Here in the function getSteps() find the line:
$stepCodes = array('billing', 'shipping','shipping_method', 'payment', 'review');
and replace it with:
$stepCodes = array('shipping','shipping_method', 'payment', 'review', 'billing');

Open the file app\design\frontend\default\default\template\checkout\onepage.phtml
Here find the following JavaScript code:
<script type="text/javascript">
//<![CDATA[
    var accordion = new Accordion('checkoutSteps', '.head', true);
    <?php if($this->getActiveStep()): ?>
    accordion.openSection('opc-<?php echo $this->getActiveStep() ?>');
    <?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') ?>'}
    );
//]]>
</script>
and replace it with:
<script type="text/javascript">
//<![CDATA[
    var accordion = new Accordion('checkoutSteps', '.head', true);
    <?php if($this->getActiveStep()): ?>
    accordion.openSection('opc-<?php echo $this->getActiveStep() ?>');
    <?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') ?>'}
    );
 document.getElementById('checkout-step-billing').style.display = 'none';
 billing.save();
 document.getElementById('opc-billing').style.display = 'none';
//]]>
</script>
<span id="loding-please-wait" style="padding-right:50%"; class="please-wait" >
            <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading steps please wait...') ?>" title="<?php echo $this->__('Loading next step...') ?>" class="v-middle" /> <?php echo $this->__('Loading steps please wait...') ?>
</span>

And you are done!
I hope you will enjoy the simplest trick.

17 comments

not woeking :)

it's working and i also want to hide the payment method also so can you help me

Perfect !!!!! Thanks

This method is working. However, only if the user that starts the checkout proces has it's full address data already set in his account. If the billing part doesn't validate, an alert appears with the validation errors... (Magento 1.6)

Gijs , were you able to hide those alerts?

I solved the alert problem by making entering an address obligatory in registration and disabling address administration in user panel. I that way person has only one address and he cant delete it. If he goes to address administration page, he gets redirected to first address(If he tries switches off redirects, there will be a blank page) he has and he will have it due to registration. In that way all users have exactly one valid address which will be auto chosen in checkout. In this way its possible bypass 2 steps in checkout.

After bypassing the billing information step, the shipping method step is displayed. I want to display the shipping information step instead of the shipping method step. How it is possible ?

How do you disable Address Administration in user panel? I can't seem to find it. TIA

This modification have 1 problem: when adress information is empty it doesn't show billing window and shows only warning. So basically checkout options buy as a guest or sign up don't work. And only when customer logs in in checkout, then he can buy.

To fix that, i made those changes:

1. file "..template\checkout\onepage.phtml"

- at the end of file, i removed these lines:

document.getElementById('checkout-step-billing').style.display = 'none';
billing.save();
document.getElementById('opc-billing').style.display = 'none'

2. file "..\template\persistent\checkout\onepage\billing.phtml"

- at the end of file add these lines:

< ?php if ($this->customerHasAddresses()): ?>
< script type="text/javascript">
$('#co-billing-form').ready( function(){
document.getElementById('checkout-step-billing').style.display = 'none';
billing.save();
document.getElementById('opc-billing').style.display = 'none';
});

< ?php endif; ?>

Here we add a check if a customer have adress information. If yes - we hide billing window.

3. File "..app\code\core\Mage\Checkout\Block\Onepage.php" was not modified

Now if a customer wants to buy as a guest or wants to sign up in checkout he will be able to fill in billing information. If customer logs in, then billing information will not be visible and he automatically goes to Method of Delivery

Magento 1.6.2.0

Hi,
Its really nice information. Thanks for sharing your effort:)

thanks for code but to disable alert box appearing....

I want to Bypassing shipping method Information too. What will be the solution for Bypassing shipping method step?

its not working. can u please explain more or tell we another way

Is there a way to do this only if downloadable products are involved?

Cheers Marek

Marek, I'm unsure of the details but I imagine you would need to start by doing something like (psuedo code alert!)
if($this->$downloadableAttribute != true){
original $stepCodes array order }
else
{revised $stepCodes array order }

I can't think off the top of my head what to do with the javascript. Hope this helps

How can we make Shipping and Billing in one step.. and rest in normal as it is..

I want to hide billing information at initially of checkout process.. page loading itself shows the shipping information.. Any one can help me

We would love to hear from you...

back to top