Preselect "Ship to this address" in the billing section of checkout

Last modified by Andrej on Thu, June 24, 2010 17:09
Source|Old Revisions  

Open “app/design/frontend/<yourtheme>/<yourtheme>/template/checkout/onepage/billing.phtml” and add before the line

  1. <form id="co-billing-form" action="">

the following lines:

  1. <?php
  2. $session = Mage::getSingleton('core/session');
  3. if (intval($session->getPreselectedAddressOption()) !== 1) {
  4.     $session->setPreselectedAddressOption('1');
  5.     $this->getQuote()->getShippingAddress()->setSameAsBilling(true);
  6. }
  7. ?>

That way you have the functionality without modifying the core.




 

Magento 2 GitHub Repository

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs