Vikas
Vikas

Reputation: 354

Get billing information in order review section of one page checkout in Magento

I am trying to display the billing and shipping information in the "Order Review" section of One Page Checkout in 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/

Any help would be greatly appreciated! Thanks in advance.

Upvotes: 5

Views: 7883

Answers (3)

user4837126
user4837126

Reputation:

You can get Billing information through this code:

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

Upvotes: -1

Darin Kolev
Darin Kolev

Reputation: 3411

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:

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

Upvotes: 1

Roscius
Roscius

Reputation: 1534

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.

Upvotes: 8

Related Questions