1

I'm trying to combine the billing and shipping addresses into just one option on the one page checkout. Using a modified rwd theme and am looking for some direction on how to implement this. Anyone have any ideas?

5

Copy app/code/core/Mage/Checkout/Block/Onepage/Abstract.php to local code pool. Find the following method _getStepCodes. And remove 'shipping' from return result

protected function _getStepCodes()
{
    return array('login', 'billing', 'shipping_method', 'payment', 'review');
}

Copy skin/frontend/base/default/js/opcheckout.js from base/default theme to your current theme for example rwd/default. Find the following line:

this.steps = ['login', 'billing', 'shipping', 'shipping_method', 'payment', 'review'];

and remove 'shipping' item from array:

this.steps = ['login', 'billing', 'shipping_method', 'payment', 'review'];

Also you need update controller app/code/core/Mage/Checkout/controllers/OnepageController.php. You can override controller in your custom module or edit OnepageController.php directly. Find the method saveBillingAction and remove or comment following lines:

$result['allow_sections'] = array('shipping');
$result['duplicateBillingInfo'] = 'true';

Copy app/code/core/Mage/Checkout/Block/Onepage/Shipping.php to local code pool. Find the isShow and replace with:

public function isShow()
{
    return false;
}

Copy app/design/frontend/base/default/template/checkout/onepage/billing.phtml from base/default theme to your current theme, for example rwd/default. Or if you use persistent shopping cart the do it for app/design/frontend/base/default/template/persistent/checkout/onepage/billing.phtml.

Find the following section...

<?php if ($this->canShip()): ?>
    <li class="control">
        <input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_yes" value="1"<?php if ($this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> title="<?php echo  $this->__('Ship to this address') ?>" onclick="$('shipping:same_as_billing').checked = true;" class="radio" /><label for="billing:use_for_shipping_yes"><?php echo  $this->__('Ship to this address') ?></label></li>
    <li class="control">
        <input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_no" value="0"<?php if (!$this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> title="<?php echo $this->__('Ship to different address') ?>" onclick="$('shipping:same_as_billing').checked = false;" class="radio" /><label for="billing:use_for_shipping_no"><?php echo $this->__('Ship to different address') ?></label>
    </li>
<?php endif; ?>

...and remove it. Find the following section...

<?php if (!$this->canShip()): ?>
    <input type="hidden" name="billing[use_for_shipping]" value="1" />
<?php endif; ?>

...and just remove if condition

<input type="hidden" name="billing[use_for_shipping]" value="1" />

As a result you have combined address step which will be using as billing and shipping.

  • Yes , it works . i try shipping and billing address in one page . this help me on it . Thanks – Pratik Kamani Feb 8 '16 at 8:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.