Get all attribute options

To get all attribute options from a Magento dropdown attribute (select field) you can use the following snippet: <?php $oAttibute = Mage::getModel(‘eav/config’)->getAttribute(Mage_Catalog_Model_Product::ENTITY, ‘sheldon_special’); $aOptions = $oAttibute->getSource()->getAllOptions(); var_dump($aOptions); That gives you an array like that: <?php $aOptions = {array} [6] 0 = {array} [2] label = “” value = “” 1 = {array} [2] label = […]

Image system configuration field

To add an image selector field to your system configuration: <image> <label>Image</label> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> <sort_order>70</sort_order> <frontend_type>image</frontend_type> <backend_model>adminhtml/system_config_backend_image</backend_model> <upload_dir config=”system/filesystem/media” scope_info=”1″>customer/responsible_contacts</upload_dir> <base_url type=”media” scope_info=”1″>customer/responsible_contacts</base_url> <show_in_default> <enabled>1</enabled> </show_in_default> </image>

System configuration fields

There are different field types for Magento’s system configuration. These are for example: Button Checkboxes Checkbox Date File Hidden Imagefile Image Label Link Multiline Multiselect Note Obscure Password Radio Radios Reset Select Submit Textarea Text Time The following snippets show you how to add them to your system.xml: Enable selection (yes/no): <?xml version=”1.0″?> <config> <sections> […]