During onepage checkout, a customer has the option to enter a new shipping address and save this address to their profile. This functionality is broken (probably due to custom code) and I'm attempting to debug it.

In Mage_Checkout_Model_Type_Onepage::saveShipping, a call is made to $address->setSaveInAddressBook. It's my understanding that this flag should cause the address to be saved at the final step of checkout.

What block of code actually causes this address to be saved? I'd like to debug the save point and work backwards to find my bug, but I can't find the point where the shipping address is saved.

  • You've tagged this post both magento-1.7 and magento-enterprise - there is no EE 1.7 release ... – choco-loo May 16 '13 at 17:10
  • I removed the CE tag. I tagged both because the code is the same for EE and CE. Technically, I'm working in EE. – Ryre May 16 '13 at 17:11

Take a look at the method _prepareCustomerQuote() in Mage_Checkout_Model_Type_Onepage (assuming you're using onepage checkout). It sets the address onto the customer there.

The customer is saved in the method submitOrder() in Mage_Sales_Model_Service_Quote.

  • Thanks! Interestingly enough, my problem ended up being the save_in_address_book flag not being populated due to some theme changes. – Ryre May 17 '13 at 15:13

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.