Last active
October 16, 2018 07:53
-
-
Save herveguetin/6f361d33495c0bd62d7b to your computer and use it in GitHub Desktop.
The right way to get country name for an order address in Magento
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// For billing address | |
$order->getBillingAddress()->getCountryModel()->getName() | |
// For shipping address | |
$order->getShippingAddress()->getCountryModel()->getName() | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Doesn't work
Uncaught Error: Call to a member function getName() on null