【发布时间】:2011-05-20 17:18:46
【问题描述】:
如何获取客户数据,以便将其传递给网关支付。
这是我的模型:
public function getStandardCheckoutFormFields() {
$orderIncrementId = $this->getCheckout()->getLastRealOrderId();
$order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);
//$order = $this->get_sale_order($orderIncrementId);
echo Mage::getModel('customer/customer')->load($orderIncrementId);
$productArray = array();
foreach ($order->getAllItems() as $item) {
$productArray[] = array(
"product_name" => $item->getName(),
"product_qty" => $item->getQtyOrdered(),
"product_price" => $item->getPrice(),
);
}
return $productArray;
}
这是我的控制器:
public function redirectAction(){
$session = Mage::getSingleton('checkout/session');
$session->setAsurepayCustompayQuoteId($session->getQuoteId());
$this->getResponse()->setBody($this->getLayout()->createBlock('custompay/redirect')->toHtml());
$session->unsQuoteId();
$session->unsRedirectUrl();
}
这运行得很完美,问题是我无法获取客户详细信息,例如客户姓名、地址等。
我已经尝试过这段代码
Mage::getSingleton(customer/customer)->getData();
有结果但未打印。
在结帐页面成功(单页)。当客户重定向到这里时,不会向客户发送电子邮件,并且订单未更新为已完成。
【问题讨论】:
标签: php zend-framework magento