简体   繁体   中英

How to retrieve email addresses in shipment and billing onepage checkout [magento]

I was looking for solutions on how to retrieve a value from the checkout form of Magento. I know how to get the billing email through this line of code:

{{htmlescape var=$order.getBillingAddress().getEmail()}}

but the shipment email is what I can't retrieve. Is there anyway to get it?

The shipment entity, or shipping address entity do not have an email field. My recommendation is to use the e-mail address from the order object like this:

{{var $order.getCustomerEmail()}}

General
When calling in an e-mail template something like {{var $object.doSomething()}} This translates into $object->doSomething() . So if you want to see what you can retrieve from the shipment object, just check the methods available in the Mage_Sales_Model_Order_Shipping class and it's parents.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM