setAttributeFilter($attribute->getId()) ->setStoreFilter(Mage::app()->getStore()->getId(), false) ->load(); foreach ($valuesCollection as $item) { $values[$item->getId()] = $item->getValue(); } return $values; } public function custom($attr) { $orderAttributes = Mage::getModel('amorderattr/attribute')->load($this->getId(), 'order_id'); $attribute = Mage::getModel('eav/entity_attribute')->load($attr, 'attribute_code'); if ($attribute->getAttributeId()) { switch ($attribute->getFrontendInput()) { case 'select': case 'boolean': $values = $this->_getStoreValues($attribute); $options = $attribute->getSource()->getAllOptions(true, true); foreach ($options as $i => $option) { if (isset($values[$option['value']])&&($option['value'] == $orderAttributes[$attribute->getData('attribute_code')])) { $value = $values[$option['value']]; } elseif ($option['value'] == $orderAttributes->getData($attribute->getAttributeCode())) { $value = $option['label']; } } break; case 'checkboxes': $values = $this->_getStoreValues($attribute); $options = $attribute->getSource()->getAllOptions(true, true); $checkboxValues = explode(',',$orderAttributes->getData($attribute->getAttributeCode())); foreach ($options as $i => $option) { if (in_array($option['value'], $checkboxValues) ) { $value[] = $values[$option['value']]; } } $value = implode(', ',$value); break; default: $value = $orderAttributes->getData($attribute->getAttributeCode()); break; } return $value; } } }