Make “Ship to This Address” Default in Magento Checkout
Add to Favourites
|
Through my dealings with several online E-Commerce stores, I’d say about 80% of customers want to have their goods delivered to the address that their card is registered to (their invoice address). Not many people opt to have it to a different delivery address, therefore many Magento users have been asking me how to make this option default. Well, it’s quite easy really, and is only a simple edit.
Just navigate to: app/code/core/Mage/Checkout/Block/Onepage/Billing.php and replace…
1 2 3 4 5 6 7 8 | public function isUseBillingAddressForShipping() { if (($this->getQuote()->getIsVirtual()) || !$this->getQuote()->getShippingAddress()->getSameAsBilling()) { return false; } return true; } |
..with…
1 2 3 4 5 6 7 8 9 | public function isUseBillingAddressForShipping() { if (($this->getQuote()->getIsVirtual()) || (!$this->getQuote()->getShippingAddress()->getSameAsBilling())) { return true; } else { return false; } } |
Hope that helps!
about the author
This article was written by Sam Davis on November 27, 2008.
Computing over a glass of Grenache Shiraz... again! Sam is the Editor of Blasted Thing. Contact Us |
related articles
comments
19 Responses to “Make “Ship to This Address” Default in Magento Checkout”
Leave a Reply
![]() Secpay Module for Magento |





























Exactly what I was looking for! Thanks. It’s too bad one has to assemble most of the information about Magento via Google and blogs…
Fine, this was the information i was looking for.
But you alter the core-code, so you cannot update anymore your magento install. Varien says you should make changes to the core in the app/locale folder (not sure how) to be sure the core files can be updated.
It has seemed to work to some extent. What happens is when a customer goes to the checkout screen, initially it is set to deliver to this address. All good at this stage.
Now still in checkout screen, continue selecting the delivery methods and now click on the sidebar change billing to go back to the billing step. The radio button is still in delivery to this address. All good here.
Now click on My Cart or somewhere else to go back and continue shopping. Add a item and go to checkout now. At this stage the radio button has changed to Delivery to different address. It seems like it has lost track of what was selected.
Any suggestions?
Thanks
This was VERY helpful…I needed to disable the shipping block while keeping the shipping method block. It wouldn’t pull the shipping options because the shipping block was disabled, and this did the trick. Thanks a million!
I am confused… Yes this will work, but the code is now illogical.
From looking at the code. You’ve basically changed a line which said:
“If the shipping address IS NOT the same as the billing address, then DON’T check the ‘use same address’ box”
to now say:
“If the shipping address IS NOT the same as the billing address, then DO check the ‘use same address’ box”
The first line made logical sense… the second one doesn’t.
I searched for a solution in the magento-forum, but I got no answer. After some weeks someone gave me the tip, to look at your page. Great thanks for your help!
I tried the solution above, but it doesn’t work for me. I’ve been spending all night finding a solution for this, but till now I didn’t find any.
I did find many suggestions and ‘hacks’ to make this work, but even the quick and dirty methods don’t work in my case.
This should be a setting in the Admin section.
This proposed solution is BAAaadddd and totally illogic.
Yes it should be an option in the Admin, but the more logical is that the default is “same adress”… Sometimes Varien does thing over their shoulder…
So here is the solution, i haven’t tested it a lot yet, but i think it’s working:
- Go in your DB admin (phpmyadmin
- Find table “sales_flat_quote_address”
- Find “same_as_billing”
- its default should be 0. Just modify it to 1
- Tadaaa
Pol: your solution did not work for me?!
still the same…..
any ideas?
pol your a genius that worked!!!
Pol, that’s the best solution out there. This way everything remains clean, thanks a lot!!!
Jacco
Hi Pol
Any ideas as to why it didn’t make any difference to edit in the “same_as_billing”?
TIA
The corresponding SQL query for Magento 1.3.2.4 is:
alter table sales_flat_quote_address change same_as_billing same_as_billing tinyint(1) unsigned not null default 1;
+1 to @Pol’s solution — worked perfectly!
This worked great. I’d also like to change the default for logged in users going through checkout. For logged in users it still default to ’ship to different address’ and i’d like it to default to ’ship to this address’
Any tips?
thanks again
Hi Sam,
i tried it on my website http://laptop.com.hr and it works! Thanks a lot!
It does work, but only if you grab a new session or something. I tried this, cleared my cache in firefox and the magento cache and it still defaulted on the second radio-box.
I launched Safari and it did work
So after I cleared the active logins and cookies for firefox it worked!
pol, you are a genius!
Pol….. You Rock!!!