Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8764355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:00:49+00:00 2026-06-13T16:00:49+00:00

I have another question for you guys :P On the product grid view i

  • 0

I have another question for you guys 😛

On the product grid view i want to change the image when you hover over it with your mouse.
The image i want to switch it too should have a labelname of ‘back’.

I almost have it..:P

When i use this code in media.phtml:

<?php $imageByLabel = $_product->getMediaGalleryImages()->getItemByColumnValue('label', 'back');?>
<?php echo $this->helper('catalog/image')->init($_product, 'image', $label->getFile())->resize(235, 350);?>

It returns something like this: http://www.mywebsite.com/product/images/image1
When i use this in the source attribute of my image it displays the correct image.

But when i use this code in the catalog/product/list.phtml i get the following error:

Fatal error: Call to a member function getItemByColumnValue() on a non-object in C:\Development\FabriqMagento\app\design\frontend\default\fabriq\template\catalog\product\list.phtml on line 95

PS: line 95 is the following line:

<?php $imageByLabel = $_product->getMediaGalleryImages()->getItemByColumnValue('label', 'back');?>

Any help is appreciated:)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T16:00:50+00:00Added an answer on June 13, 2026 at 4:00 pm

    If you review your code, $imageByLabel is not doing anything so it is not needed.

    Try:

    <?php echo Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages()->getItemByColumnValue('label','black')->getFile();  ?>
    

    from list.phtml

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Another jQuery question for you guys. Say I have a url of an image
i have another (probably unanswered) question about map views. I have a map view
Hey guys i have another question about dojo. This time it has to do
Sorry guys, it's another CSS height 100% (sortof) question... I have a layout like
i have another question on getting my XML serialization neat, which i can't seem
I have another question :(. I'm trying to download multiple files for my application.
I have another question and I can't seem to find anything on Google. What
Okay, so I have another question on a prolog homework problem I am struggling
I have another simple question about Node. I'm trying to make a simple http
I have another Richfaces question which may seem rather weird. I am developing a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.