It seems like the function isUseBillingAddressForShipping()
(search for that here on MAGE:SO) seems to be broken, at least on our systems. Whatever you choose in the backend, this function always returns true
.
If that value would change, the checkout with automatic selection of billing/shipping address would most probably work. That is at least how it's supposed to work with the default Onepage Checkout.
We have implemented the following solution to this issue:
First copy the app/design/frontend/base/default/template/checkout/onepage/billing.phtml
to your own theme, so it could look like this: app/design/frontend/your-theme/default/template/checkout/onepage/billing.phtml
Around line 186 in that file you will find a block that starts with <?php if ($this->canShip()): ?>
which then takes care about outputting the radio buttons.
Add the following block right after the previous PHP if-clause:
<?php
$customer = Mage::getSingleton('customer/session')->getCustomer();
$ShippingIsBilling = false;
if($customer[default_billing] === $customer[default_shipping])
{ $ShippingIsBilling = true; }
?>
This will get the logged in customers object (only logged in customers can have saved addresses). This object stores links to the default billing and shipping address ID. When those IDs match, billing and shipping address are the same.
You can now simply change any calls for $this->isUseBillingAddressForShipping()
change for $ShippingIsBilling
. Other changes are not needed.