When we think about countries collection in our programming knowledge we must first think there would database collection, but in magento that doesn’t happen. That happens through XML files and loads on each request, it doesn’t store country information in database. So here our concern is how we can Create dropdown of countries in frontend and backend as well. Well it’s a very tricky to do that . let see I am going to show you both ideas of frontend and backend.
Front End Postion:
You can use below code in any template file that you want to show over that location.
Back End Position:
Generally in magento backend form we don’t use any custom HTML attributes , because forms are build using pre-build function. So here we will follow magento syntax to add our custom html elements as country drop in that form. So lets see how easy to Create dropdown of countries in magento admin form.
So finally from above two situatio we got to know we can collect country collection from anywehre in mganeto by following code:
if you will see the log file then you will be getting all list of countries with their codes
also we can get that by system configuration filed section that is:
Same way here you can see your all country details through log file
Hope you enjoyed this article and will never forge to share to help other