jruzafa
6/1/2015 - 7:55 PM

#Source select attributtes for #configurable (#superattributes) #magento

#Source select attributtes for #configurable (#superattributes) #magento

public function getSourceSuperAttribute (){
       $superAttrData = array();
       $attributes = Mage::getSingleton('eav/config')
           ->getEntityType(Mage_Catalog_Model_Product::ENTITY)
           ->getAttributeCollection()
           ->addFieldToFilter('is_global', 1)
           ->addFieldToFilter('is_configurable', 1)
           ->addFieldToFilter('is_user_defined', 1)
           ->addFieldToFilter(array('apply_to','apply_to'),array(
               array('null' => 'true' ),
               array('like' => '%configurable%'),
           ))
           ->addSetInfo()
           ->toArray();


       foreach ($attributes['items'] as $_attr) {
           $superAttrData[$_attr['attribute_id']] = $_attr['frontend_label'].' ('.$_attr['attribute_code'].')';

       }

       return $superAttrData;
}