Dec 31, 2011
kalpesh

Magento: Getting more than one records from core_config_data table

To select any particular record from core_config_data table in magento is quite simple.

Mage::getStoreConfig('sales_email/order/template');

But what if you want all the data pertaining to sales order email or for any other thing stored in magento’s config table? You may need other data like “enabled”, “identity”, “guest_template”, “copy_to” which can accomplish otherwise in 5 requests.
So here is how you should write the code to get all the data for some particular expression as per your need.

$qrySalesOrder = Mage::getModel('core/config_data')->getCollection()->addFieldToFilter('path',array('like'=>'sales_email/order/%'));
//Mage::log($qrySalesOrder);

Leave a comment

 

Welcome to my Blog

Kalpesh MehtaHelping Magento developers in their day-to-day development problems since 2011. Most of the problems and solutions here are my own experiences while working on different projects. Enjoy the blog and don't forget to throw comments and likes/+1's/tweets on posts you like. Thanks for visiting!

Certifications

Honor

Recognition

Magento top 50 contributors

Magento top 50 contributors

Contributions