Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 746
Bob van Luijt Avatar asked Nov 26 '12 13:11

Bob van Luijt


1 Answers

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

Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getFirstname();
like image 100
user487772 Avatar answered Oct 17 '22 04:10

user487772