7

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?

Community
  • 1
  • 1
Bob van Luijt
  • 7,153
  • 12
  • 58
  • 101

1 Answers1

11

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

Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getFirstname();
user487772
  • 8,800
  • 5
  • 47
  • 72