/** * Retrieve option values collection * It is represented by an array in case of system attribute * * @param Mage_Eav_Model_Entity_Attribute_Abstract $attribute * @return array|Mage_Eav_Model_Resource_Entity_Attribute_Option_Collection */ protected function _getOptionValuesCollection(Mage_Eav_Model_Entity_Attribute_Abstract $attribute) { if ($this->canManageOptionDefaultOnly()) { $options = Mage::getModel($attribute->getSourceModel())->setAttribute($attribute)->getAllOptions(true); return array_reverse($options); } else { return parent::_getOptionValuesCollection($attribute); } }
/** * Retrieve attribute option values for given store id * * @param integer $storeId * @return array */ public function getStoreOptionValues($storeId) { if ($storeId) { $values = $this->getData('store_option_values_' . $storeId); if (is_null($values)) { $values = array(); /* @var $valuesCollection Flagbit_MEP_Model_Mysql4_Attribute_Mapping_Option_Collection */ $valuesCollection = Mage::getResourceModel('mep/attribute_mapping_option_collection')->addFieldToFilter('parent_id', $this->getAttributeMappingObject()->getId())->setStoreFilter($storeId, false)->load(); foreach ($valuesCollection as $item) { $values[$item->getOptionId()] = $item->getValue(); } $this->setData('store_option_values_' . $storeId, $values); } } else { $values = parent::getStoreOptionValues($storeId); } return $values; }
protected function _prepareLayout() { $this->setChild('quickAddBtn', $this->getLayout()->createBlock('adminhtml/widget_button', null, array('label' => Mage::helper('mtattribute')->__('Quick Add'), 'onclick' => 'attributeOption.quickAdd()', 'class' => 'add', 'type' => 'button'))); parent::_prepareLayout(); }
public function __construct() { parent::__construct(); $this->setTemplate('emtabs/options.phtml'); }
/** * Set template used by Product Attributes edit form */ public function __construct() { parent::__construct(); $this->setTemplate('catalog/product/attribute/options.phtml'); }