Magento 1.5.1 - How can I add the customer's billing email address to success.phtml -
i've added following code magento 1.5.1 order confirmation page (success.phtml):
<?php $_order_id = mage::getsingleton('checkout/session')->getlastorderid(); // here oreder id $_order->load($_order_id); $customer = mage::getsingleton('customer/session')->getcustomer(); $email = $customer->getemail(); // email address of customer. ?> email confirmation sent to: <?php echo $email ?>
unfortunately email variable empty/null.
does know how efficiently data? obtaining first , last name bonus.
keep in mind guest checkout allowed, may not have customer record in cases. in case, need billing email address assosicated order (guest checkout or not.)
thanks!
if got order object maybe can use:
$order->getbillingaddress()->getemail();
i think method better because can use guest customers too.
Comments
Post a Comment