Fixed Magento Checkout : Set ‘Ship to This Address’ as Default

Written by Gordon

Topics: Magento

How often would you buy from an online shop and ship the goods to an address that is different from your billing address? Sometimes, I do use the card that is registered with my home address, but use my office address for delivery. This might not be the same case with about 80% of online shoppers.

Then, why does Magento eCommerce select the “Ship to different address” option as default!? Here is a way to fix it and make Magento to select “Ship to this address” by default.

Magento FIX :

Copy app/code/core/Mage/Checkout/Block/Onepage/Billing.php to app/code/local/Mage/Checkout/Block/Onepage/Billing.php. This ensures that you do not end up messing with Magento’s core files.

Nagivate to the function

public function isUseBillingAddressForShipping()
{
if (($this->getQuote()->getIsVirtual()) || !$this->getQuote()->getShippingAddress()->getSameAsBilling())
{
return false;
}
return true;
}

Swap around the returns “false” and “true”

public function isUseBillingAddressForShipping()
{
if (($this->getQuote()->getIsVirtual()) || !$this->getQuote()->getShippingAddress()->getSameAsBilling())
{
return true;
}
return false;
}

That’s a good fix. Enjoy working with Magento eCommerce!

3 Comments Comments For This Post I'd Love to Hear Yours!

  1. simon says:

    I’m not sure if this is from an old version of Magento but in 1.5 app/code/local/Mage/ is actually app/code/local/GoMage/ so you need to create a new series of directories: app/code/local/Mage/Checkout/Block/Onepage/ and then put Billing.php in there. I have no idea if thats what you meant but just thought I would clarify.

    Thanks a lot for the post! Cut out a lot of my searching & breaking things time!

Leave a Comment Here's Your Chance to Be Heard!