I need to get the the Selected Allowed Countries in a phtml file..

How can i get that ?

  • you have created custom or for default ? – Yogesh Nov 7 '17 at 11:07

You can fetch the Allowed Countries List using the below Code:

public function __construct(
    /* Add below dependencies */
    \Magento\Directory\Model\AllowedCountries $allowedCountryModel
) {
    $this->allowedCountryModel = $allowedCountryModel;

//Call the below function to fetch countires        
|improve this answer|||||
  • 1
    this returns only shortcode of all countries. How can i get full names too? – Khushbu Jun 19 '19 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.