Reputation: 2647
I've created a new attribute set from "Default" attribute set.But the media_gallery
attribute is missing in the new attribute set.So the image uploader is not showing in product edit section.How do I add that system attribute to the set?
Upvotes: 2
Views: 1847
Reputation: 14182
You can also use PHP to assign attributes to attribute sets:
$installer = Mage::getResourceModel('catalog/setup', 'catalog_setup');
$installer->addAttributeToSet(
'catalog_product', $attributeSetName, $groupName, $attributeCode
);
Upvotes: 2
Reputation: 9100
This is at least strange. I would suggest trying to re-create an attribute set based on "Default" to check if the problem will happen again.
In any ways, if you want to add a media_gallery
attribute to your existing attribute set you have to add a record to eav_entity_attribute
table, where relation of EAV entity to attribute set and group is stored:
INSERT INTO eav_entity_attribute
SET entity_type_id = 4,
attribute_set_id = [YOUR_ATTRIBUTE_SET_ID],
attribute_group_id = [YOUR_ATTRIBUTE_GROUP_ID],
attribute_id = [ID_OF_YOUR_MEDIA_GALLERY_ATTRIBUTE by default 82],
sort_order = 4
The ID_OF_YOUR_MEDIA_GALLERY_ATTRIBUTE
can be found in eav_attribute
table using the following query:
SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'media_gallery'
The YOUR_ATTRIBUTE_SET_ID
can be found in eav_attribute_set
table using the following query:
SELECT attribute_set_id FROM eav_attribute_set WHERE attribute_set_name = '[GIVEN_NAME_OF_YOUR_ATTRIBUTE_SET]'
And the YOUR_ATTRIBUTE_GROUP_ID
can be found in eav_attribute_group
table using the following query:
SELECT attribute_group_id FROM eav_attribute_group WHERE attribute_set_id = [YOUR_ATTRIBUTE_SET_ID] AND attribute_group_name = 'Images'
Upvotes: 5
Reputation: 3634
It is not a programming question, rather it is the question about using Magento as an end-user. I think the question will be deleted soon. However, until it is not, at least this answer may help to solve the problem, thus making people happier.
So all you need is just go to Magento's admin panel -> Catalog -> Attributes -> Manage Attribute Sets. Then select your set to open edit page for it. Drag the media_gallery
attribute from the "Unassigned Attributes" list to the appropriate group in the "Groups" list. Save the attribute set.
That's all :)
Upvotes: 0