SHARE
TWEET

Untitled

a guest Feb 19th, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <sales_order_save_before>
  2.     <observers>
  3.         <custom_observer>
  4.             <type>singleton</type>
  5.             <class>Custom_Module_Model_Observer</class>
  6.             <method>updateaddress</method>
  7.         </custom_observer>
  8.     </observers>
  9. </sales_order_save_before>
  10.      
  11. public function updateaddress(Varien_Event_Observer $observer) {
  12.     $session = $observer->getEvent()->getCheckoutSession();
  13.     $sessionCustomer = Mage::getSingleton("customer/session");
  14.     $quote = $this->_quote = Mage::getModel('sales/quote')->setStoreId(Mage::app()->getStore()->getId())->load($session->getQuoteId());
  15.     $address = $quote->getShippingAddress();
  16.     if (!$sessionCustomer->isLoggedIn()) {
  17.         $address->setData($reset);
  18.         $quote->setShippingAddress($address);
  19.         $quote->setBillingAddress($address);
  20.         $quote->collectTotals()->save();
  21.     }
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top