Bob van Luijt
Bob van Luijt

Reputation: 7588

Magento get chosen shipping and billing method address fields

How can I get the choosen shipping and billing fields during checkout? (I want to show them in sidebars)

I use this in shipping.phtml but ofcourse that's just for the current 'address' (and I want to use it in methods.phtml and other pages)

$this->getAddress()->getFirstname()

So I assumed that this would work out...

Mage::getSingleton('checkout/session')->getShippingAddress()->getFirstname()

But it didn't, anybody has a tip?

Addition: This one was helping me a lot, but I'm stuck :-S How do I get the shipping method the user has chosen during checkout?

Upvotes: 7

Views: 12090

Answers (1)

Tim Bezhashvyly
Tim Bezhashvyly

Reputation: 9100

Shipping and billing addresses are children of quote object. So something like this shall work:

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

Upvotes: 11

Related Questions