Public Member Functions | |
toOptionArray () | |
Public Attributes | |
const | PRODUCT_OPTIONS_GROUPS_PATH = 'global/catalog/product/options/custom/groups' |
Definition at line 34 of file Type.php.
toOptionArray | ( | ) |
Definition at line 38 of file Type.php.
00039 { 00040 $groups = array( 00041 array('value' => '', 'label' => Mage::helper('adminhtml')->__('-- Please select --')) 00042 ); 00043 00044 foreach (Mage::getConfig()->getNode(self::PRODUCT_OPTIONS_GROUPS_PATH)->children() as $group) { 00045 $types = array(); 00046 $typesPath = self::PRODUCT_OPTIONS_GROUPS_PATH . '/' . $group->getName() . '/types'; 00047 foreach (Mage::getConfig()->getNode($typesPath)->children() as $type) { 00048 $labelPath = self::PRODUCT_OPTIONS_GROUPS_PATH . '/' . $group->getName() . '/types/' . $type->getName() . '/label'; 00049 $types[] = array( 00050 'label' => (string) Mage::getConfig()->getNode($labelPath), 00051 'value' => $type->getName() 00052 ); 00053 } 00054 00055 $labelPath = self::PRODUCT_OPTIONS_GROUPS_PATH . '/' . $group->getName() . '/label'; 00056 00057 $groups[] = array( 00058 'label' => (string) Mage::getConfig()->getNode($labelPath), 00059 'value' => $types 00060 ); 00061 } 00062 00063 return $groups; 00064 }
const PRODUCT_OPTIONS_GROUPS_PATH = 'global/catalog/product/options/custom/groups' |