Hi Guys,
One day i need to pull the country collection of selected in the Allow country list in under general tab for default configuration store scope but not getting any clue for this. After 4-5 hours review the code and database table finally i success to do this. I don't know this is right way or not but it works . it may helpsome who want to such a things.......
////////////////////////////////////
$rr= Mage::getConfig()->getNode('general/country/allow','default');
$rr=explode(',',$rr);
$options =Mage::getModel('directory/country')->getCollection()
->addFieldToFilter('country_id',array('in'=>$rr))
->load()
->toOptionArray();
///////////////////////////////////////
This line $rr= Mage::getConfig()->getNode('general/country/allow','default'); help to choose the country id string for default scope value. And then we can get the selected country's list.
enjoy!!!!!
One day i need to pull the country collection of selected in the Allow country list in under general tab for default configuration store scope but not getting any clue for this. After 4-5 hours review the code and database table finally i success to do this. I don't know this is right way or not but it works . it may helpsome who want to such a things.......
////////////////////////////////////
$rr= Mage::getConfig()->getNode('general/country/allow','default');
$rr=explode(',',$rr);
$options =Mage::getModel('directory/country')->getCollection()
->addFieldToFilter('country_id',array('in'=>$rr))
->load()
->toOptionArray();
///////////////////////////////////////
This line $rr= Mage::getConfig()->getNode('general/country/allow','default'); help to choose the country id string for default scope value. And then we can get the selected country's list.
enjoy!!!!!
Thanks, you saved my life..
ReplyDeleteReally this is helpful, amazing post sir, thanks a lot.
ReplyDeleteHurrey, I was looking for the same nice work
ReplyDeleteThanks For your comments all you guys.
DeleteHI vinod do you have experience in flying cart in magento
ReplyDeleteHI Pankaj,
DeleteYes I am doing work on cart extension for magento, having this feature. I will reply soon with the download link.
Thanks
Vinod
awesome , I was looking for that
DeleteThanks,
DeleteI will be back with in one or two day after with good news.
Vinod
That's great..
Delete