在成功页面magento中获取产品名称和电话号码

在成功页面magento中获取产品名称和电话号码,magento,magento-1.9,sms-gateway,magento-dev,magento-collection,Magento,Magento 1.9,Sms Gateway,Magento Dev,Magento Collection,我使用的是magento1.9。我需要在成功页面中使用客户名称、编号和产品名称,有什么方法可以实现吗?提前感谢。假设您在成功页面中已经有订单对象 $order->getBillingAddress()->getTelephone(); $order->getCustomerName(); $ordered_items = $order->getAllVisibleItems(); foreach($ordered_items as $item) $product_

我使用的是magento1.9。我需要在成功页面中使用客户名称、编号和产品名称,有什么方法可以实现吗?提前感谢。

假设您在成功页面中已经有订单对象

$order->getBillingAddress()->getTelephone(); 
$order->getCustomerName();
$ordered_items = $order->getAllVisibleItems();

foreach($ordered_items as $item)
  $product_name[] = $item->getName();

即使有人在寻找同样的东西

$orderDetails=Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId())

获取联系电话

echo $telePhone=$orderObj->getBillingAddress()->getTelephone(); 

要获得完整的数组,请使用
print\r($orderDetails)

使用以下字段获取客户姓名和电话号码

 $order = Mage::getModel('sales/order')->load($this->getOrderId());
  if($order->getCustomerIsGuest()){
     echo $order->getBillingAddress()->getName();
     echo $order->getBillingAddress()->getTelephone();
  }
  else{
     echo $order->getCustomerName();
     echo $order->getTelephone();
  }