2

When is an address saved in the customer? I mean, is it in the checkout process when saveBilling is called? Or is in the conversion from quote to order when saveOrder is called?

In this question, save means the address can be reused by the customer in another purchase without having to type the address again.

  • What are you trying to accomplish? – Renon Stewart Sep 19 '14 at 13:33
  • I want to know where the address is being saved and related to a customer. – mbalparda Sep 19 '14 at 13:36
  • Take a look at submitOrder() in /app/code/core/Mage/Sales/Model/Service/Quote.php – Renon Stewart Sep 19 '14 at 13:44
  • Why do you think there is where the relation between customer and address is being made? – mbalparda Sep 19 '14 at 13:59
  • Upvote from me for goof questions – Amit Bera Sep 29 '14 at 17:12
1

Please look at Mage_Checkout_Model_Type_Onepage

Magento create object of customer form address

Mage::getModel('customer/form');
        $addressForm->setFormCode('customer_address_edit')
->setEntityType('customer_address');

then

on function _prepareNewCustomerQuote and _prepareCustomerQuote magento copy sales_quote_address fields object to customer address object using from field copy Mage::helper('core')->copyFieldset() function and Mage_Customer_Address function -addAddresswhich copy fields between customer_address and order quote object and here also set default shipping and billing address which default selecting on next time in checkout

  • Nice answer, Very helpful :-) – Girish SH Feb 11 '15 at 19:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.