I would like Magento to create an attribute made by other attributes: to be specific a single attribute that retrieves values from “manufacturer” “name” “sku” and one more custom attribute.
Hi Feuerbach,
It is ok. To insert to an attribute, Magento supports feature “source” so that you can customize insert data as you want. In the array that is to insert to attribute you can set ‘source’ as “name class get value to other attribute”. For example:
As the code above you can see ‘source’ => ‘giftwrap/attribute_wrappable’, I used class ‘giftwrap/attribute_wrappable’ to insert value for a new attribute ‘giftwrap’.
Hope you are succeed.
/** * Retrieve option array * * @return array */ public function getOptionArray() { $_options = array(); foreach ($this->getAllOptions() as $option) { $_options[$option['value']] = $option['label']; } return $_options; }
/** * Get a text for option value * * @param string|integer $value * @return string */ public function getOptionText($value) { $options = $this->getAllOptions(); foreach ($options as $option) { if ($option['value'] == $value) { return $option['label']; } } return false; }
Hi I’m having a Reindex Required issue. I just installed the Gift Card extension that I purchased and flushed the cache, when I try to reindex the Catalog Search Index I keep getting this warning [ Source model “giftwrap/attribute_wrappable” not found for attribute “giftwrap” ] .
After searching a few forums I found this thread and I believe this is the fix I’m looking for. Can you provide a little more detail on where exactly I need to create and put these files? Are there any other requirements that I’m missing? I followed the install instructions.