我在网上尝试了各种解决方案但无济于事。我认为它应该是这样的:
<?php
$order->getBillingAddress()->getEmail();
?>
An email confirmation was sent to: <?php echo $order->getEmail ?>
我能够显示订单ID:
<?php echo $this->getOrderId() ?>
如果您有任何建议,请尽可能具体,因为我绝对是新手。
答案 0 :(得分:7)
尝试将此添加到Success.phtml
<?php
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
echo $order->getCustomerEmail();
?>
答案 1 :(得分:0)
尝试使用此代码
$_customerId = Mage::getSingleton('customer/session')->getCustomerId();
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
$order = Mage::getSingleton('sales/order');
$order->load($lastOrderId);
然后做
foreach($order as $_order){
echo $_order->getCustomerEmail();
}
希望这有帮助