2

I created a new media attribute called 'rollover_image' for some frontend rollover functionality. Reindex was completed and attribute set was also changed - I can see the new 'Rollover Image' radio button when I go to the Images panel under Configure Products. When trying to retrieve this file, I get the following error:

Image file was not found.
#0 /home/www/booboo/app/code/core/Mage/Catalog/Helper/Image.php(166): Mage_Catalog_Model_Product_Image->setBaseFile(NULL)
#1 /home/www/booboo/app/design/frontend/enterprise/booboo/template/catalog/product/list.phtml(175): Mage_Catalog_Helper_Image->init(Object(Mage_Catalog_Model_Product), 'rollover_image')

Anyone had a similar issue? I am on Magento Enterprise ver. 1.12.0.0.

UPDATE

If there are ANY images with the 'rollover_image' media attribute not set from the category list, Magento seems to crash. Any reliable way to patch this?

2 Answers 2

4

You get this error because for some reason Magento does not allow you to select 'Used in product listing'=> 'Yes' when adding a 'Media image' attribute but you can set this manually in the database. Identify the id of your attribute and run this query:

UPDATE catalog_eav_attribute set used_in_product_listing = 1 where attribute_id = 'ID HERE'

Then reindex everything and it should work.

[UPDATE] I forgot something. You also need to create this image skin/frontend/{interface}/{theme}/images/catalog/product/placeholder/rollover_image.jpg to use a the default image for the rollover_image attribute. This way you won't get the error.
I suggest creating it in the base/default theme so it will be available for all the themes you have.

3
  • Hi Marius, Can you tell me how to use the default image for media image attribute ?
    – Sarvagya
    Dec 3, 2013 at 11:50
  • @Sarvagya. I don't understand what you mean. Please post an other question explaining your issue in details
    – Marius
    Dec 3, 2013 at 11:57
  • i have posted a new question here : magento.stackexchange.com/questions/11448/…
    – Sarvagya
    Dec 3, 2013 at 12:28
0

I would like to add to Marius's answer and say that all the options for Media Image are in the attribute edit page but are hidden (with display: none), so you could use Firebug or 'Inspect Element' from your browser to show those hidden <tr> tags and change "Used in Product Listing" to "Yes"

I haven't tried to change any other option than "Used in Product Listing" so I can't say what works and what doesn't.

Good luck :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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