Magento WizardNo joke, this website relaunches on 1st April. New look, new features!

Contact the site  Make Money

Make “Ship to This Address” Default in Magento Checkout

 Add to Favourites  
(2 rating, 4 votes)
Loading ... Loading ...

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!

  • Digg
  • del.icio.us
  • Facebook
  • Google
  • LinkedIn
  • Live
  • Reddit
  • StumbleUpon
  • Technorati
  • TwitThis

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

 One Page Checkout (Guest Customer) - Video Guide
 Change Credit/Debit Card name in Magento
 One Page Checkout (Logged In Customer) - Video Guide
 Show Product Description on Magento Shopping Cart page
 Insecure or non-secure pages on the Magento Checkout

comments

19 Responses to “Make “Ship to This Address” Default in Magento Checkout”

  1. Rob Janssen on December 19th, 2008

    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…

  2. Stefan on February 25th, 2009

    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.

  3. auslaw on May 22nd, 2009

    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

  4. Brad on May 22nd, 2009

    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!

  5. Dave on July 20th, 2009

    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.

  6. Hahnefeld on July 28th, 2009

    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!

  7. Jordy on July 29th, 2009

    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.

  8. Pol on August 26th, 2009

    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

    :)

  9. Fiete on September 16th, 2009

    Pol: your solution did not work for me?!
    still the same…..
    any ideas?

  10. dave on October 27th, 2009

    pol your a genius that worked!!!

  11. Jacco on November 5th, 2009

    Pol, that’s the best solution out there. This way everything remains clean, thanks a lot!!!

    Jacco

  12. Jimmy Rabøl Jørgensen on November 10th, 2009

    Hi Pol

    Any ideas as to why it didn’t make any difference to edit in the “same_as_billing”?

    TIA

  13. Sebastian B. on December 23rd, 2009

    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;

  14. mystix on December 31st, 2009

    +1 to @Pol’s solution — worked perfectly!

  15. Ann-Marie Fleming on January 4th, 2010

    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

  16. Laptop on January 7th, 2010

    Hi Sam,

    i tried it on my website http://laptop.com.hr and it works! Thanks a lot!

  17. Nomark on January 11th, 2010

    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!

  18. Georg Zimmer on January 28th, 2010

    pol, you are a genius!

  19. Patrix on March 6th, 2010

    Pol….. You Rock!!! :)

Leave a Reply




Spam protection by WP Captcha-Free


Secpay Module for Magento

  • Sponsored Ads

  • Magento Themes
    • vtiger: great article, thank you....
  • Recent Tweets

    @PepaBCN pero eso no es solo CSS, mira esto: http://es.wikipedia.org/wiki/Magento sirve para montar tiendas online y es gratis :)

    Ultimate Guide To Creating E-Commerce Websites With Magento (Part 1): http://tinyurl.com/ygmbeqh #webdesign #ecommerce

    Magento Scores $22.5 Million For Open Source E-commerce Platform Play http://bit.ly/bhqWdn

    Nah, não preciso mais de ninguém que manje de #magento. Valeu pela ajuda galere.

    RT @corinthiana: Preciso de alguém que manja de #magento #freela #diabo #NOW