获取帐单信息在Magento中一页结帐的订单审阅部分

问题描述:

我试图在Magento 1.7.0的一页结帐的“订单审核”部分显示帐单和货运信息。获取帐单信息在Magento中一页结帐的订单审阅部分

但是,它根本不想合作。我尝试了各种论坛和SO中提到的几种方法。但是这些方法都没有效果。

这是我已经尝试过的。

http://www.magentocommerce.com/boards/viewthread/55281/

http://www.magentocommerce.com/boards/viewthread/55281/

任何帮助将不胜感激! 在此先感谢。

Mage::getSingleton('checkout/session')->getQuote() 
             ->getShippingAddress() 
             ->getData(); 


Mage::getSingleton('checkout/session')->getQuote() 
             ->getBillingAddress() 
             ->getData(); 

会为您提供当前订单的结算和运输信息。根据上下文,你可能还需要调用

Mage::getSingleton('checkout/session')->getQuote() 
             ->collectTotals(); 

对于为了税收,分类汇总等是正确的。

+0

我有机会尝试这一点,它的工作。非常感谢! – Vikas 2012-07-19 18:49:29

你可以得到的地址为对象:

$checkout = Mage::getSingleton('checkout/session')->getQuote(); 
$billing = $checkout->getBillingAddress(); 
$shipping = $checkout->getShippingAddress(); 

,并显示他们为HTML文本:

echo $billing->format("html"); 
echo $shipping->format("html"); 

您可以通过这个代码,获取结算信息:

Mage::getSingleton('checkout/session')->getQuote() 
            ->getBillingAddress() 
            ->getData();