【发布时间】:2011-10-09 17:52:23
【问题描述】:
我已将以下代码添加到 Magento 1.5.1 订单确认页面 (success.phtml):
<?php
$_order_id = Mage::getSingleton('checkout/session')->getLastOrderId(); // here I get the Oreder ID
$_order->load($_order_id);
$customer = Mage::getSingleton('customer/session')->getCustomer();
$email = $customer->getEmail(); // To get Email Address of a customer.
?>
An email confirmation was sent to: <?php echo $email ?>
很遗憾,电子邮件变量为空/null。
有谁知道如何有效地获取这些数据?获得名字和姓氏将是一个奖励。
请注意,客人可以结帐,因此我们可能不会在所有情况下都有客户记录。在任何情况下,我都需要与订单相关的帐单电子邮件地址(是否为客人结帐)。
谢谢!
【问题讨论】:
标签: magento magento-1.5