I can get countries like this:
$countryCollection = Mage::getModel('directory/country')->getResourceCollection()->loadByStore();
And they are listed somewhere in the object, but, how do I toOptionsArray
them out?
I'm after only the options per website rather than complete list
i.e. I want Angola, Antarctica and so on out of the list. (Sorry Angolans and penguins.)
Its actually the obvious answer:
$countryList = Mage::getModel('directory/country')->getResourceCollection()
->loadByStore()
->toOptionArray(true);
also check out http://fishpig.co.uk/magento-tutorials/list-countries-for-drop-down-in-magento for more info on creating drop-down lists and such with the country list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With