1

I would like to add a product attribute called orientation to the eav_attribute table, and add this attribute upon upload of a product image or a category image (not necessary for others but perhaps I can do that as well). I want to be able to pull this information via data vs. waiting till I have the image to analyze the information.

I have two questions:

First - what is the best approach to this? I have searched quite a bit but because of noise on terms like iOS and etc., I haven't found anything. I am fairly new and want to do this "the Magento way".

Second - how would I read this attribute in my list.phtml file?

1

For products, this will not work as an EAV attribute because it won't be an attribute for the product itself, but for each image. Images are own entities, but do not use the EAV model.

So you need to do this:

  • add a column orientation to the table catalog_product_entity_gallery
  • modify the gallery form

Categories on the other hand just have one image and do not use the gallery tables, so you can create the attribute as usual.

2
  • Sorry, I don't have a complete solution for you – Fabian Schmengler Jan 27 '16 at 22:06
  • ,it is not complete sol.Kindly add a note with answer – Amit Bera Jan 28 '16 at 11:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.