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

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 appcodecoreMageCheckoutBlockOnepage.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 appdesignfrontenddefaultdefaulttemplatecheckoutonepage.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.

Written by Arvind Bhardwaj

Arvind is a certified Magento 2 expert with more than 10 years of industry-wide experience.

Website: http://www.webspeaks.in/

19 thoughts on “Bypassing Billing Information(first step) of Checkout Process in Magento!

  1. 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)

  2. 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.

  3. 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 ?

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

  5. 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 “..templatecheckoutonepage.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 “..templatepersistentcheckoutonepagebilling.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 “..appcodecoreMageCheckoutBlockOnepage.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

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

  7. 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

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

  9. hi we are using magento1.9.3,as per our requirement we have bypassed the add to cart and its directly going to checkout……but now we should bypass the product and it should directly go to checkout………..can anybody please help us to achieve it????????????if so then it will be very helpfullllllll….

    Thanks in advance.

Comments are closed.