tags:

views:

43

answers:

1

Hello,

I've added an image attribute with name and label e.g. New Image, new_image.

How do I fetch this from e.g. view.phtml? I thought it would be as simple as

helper('catalog/image')->init($_product, 'new_image')->resize(150, 150); ?>

But, this is throwing an error.

Does anybody know the correct way to do this?

Many thanks.

A: 

There are only a few valid string values for that init call: image, small_image and thumbnail, corresponding to the product attributes for those images. If you want to call the images that way, you'll need to set the new_image to be one of those three images in the administration panel.

Otherwise, look for "gallery" methods on the product, as those will give you all your images to iterate through.

Thanks, Joe

Joseph Mastey
Hello, thanks for the reply.So, you can only call image, small_image and thumbnail that way?I've added the attribute new_image as type media image.What's the best way to fetch that image in view.phtml?Also, how would I exclude images from the more views/gallery? Specifically, the new_image?Many thanks,Adam
Schonkton