I am trying to display the billing and shipping information in the "Order Review" section of One Page Checkout in Magento 1.7.0.
我试图在Magento 1.7.0中的一个页面检出部分的“订单评审”部分显示账单和发货信息。
However, it just doesn't want to co-operate at all. I tried several methods mentioned in various forums and in SO as well. But none of these methods seem to work.
然而,它根本不想合作。我尝试了各种论坛和论坛中提到的几种方法。但这些方法似乎都不管用。
Here are the ones I have already tried.
这是我已经试过的。
http://www.magentocommerce.com/boards/viewthread/55281/
http://www.magentocommerce.com/boards/viewthread/55281/
http://www.magentocommerce.com/boards/viewthread/55281/
http://www.magentocommerce.com/boards/viewthread/55281/
Any help would be greatly appreciated! Thanks in advance.
如有任何帮助,我们将不胜感激!提前谢谢。
3 个解决方案
#1
8
Mage::getSingleton('checkout/session')->getQuote()
->getShippingAddress()
->getData();
Mage::getSingleton('checkout/session')->getQuote()
->getBillingAddress()
->getData();
Will give you arrays with the billing and shipping information for the current order. Depending on context, you may also have to call
将为您提供包含当前订单的账单和发货信息的数组。根据上下文,您可能还需要调用
Mage::getSingleton('checkout/session')->getQuote()
->collectTotals();
For the order taxes, subtotals, etc to be correct.
对于订单税,小计等要正确。
#2
0
You can get the addresses as objects:
你可以获得的地址作为对象:
$checkout = Mage::getSingleton('checkout/session')->getQuote();
$billing = $checkout->getBillingAddress();
$shipping = $checkout->getShippingAddress();
and show them as html text:
并以html文本显示:
echo $billing->format("html");
echo $shipping->format("html");
#3
-1
You can get Billing information through this code:
您可以通过以下代码获取帐单信息:
Mage::getSingleton('checkout/session')->getQuote()
->getBillingAddress()
->getData();
#1
8
Mage::getSingleton('checkout/session')->getQuote()
->getShippingAddress()
->getData();
Mage::getSingleton('checkout/session')->getQuote()
->getBillingAddress()
->getData();
Will give you arrays with the billing and shipping information for the current order. Depending on context, you may also have to call
将为您提供包含当前订单的账单和发货信息的数组。根据上下文,您可能还需要调用
Mage::getSingleton('checkout/session')->getQuote()
->collectTotals();
For the order taxes, subtotals, etc to be correct.
对于订单税,小计等要正确。
#2
0
You can get the addresses as objects:
你可以获得的地址作为对象:
$checkout = Mage::getSingleton('checkout/session')->getQuote();
$billing = $checkout->getBillingAddress();
$shipping = $checkout->getShippingAddress();
and show them as html text:
并以html文本显示:
echo $billing->format("html");
echo $shipping->format("html");
#3
-1
You can get Billing information through this code:
您可以通过以下代码获取帐单信息:
Mage::getSingleton('checkout/session')->getQuote()
->getBillingAddress()
->getData();