I want to display the "exclude" product images in a section on my product page. How can I do this?


Here is how I would do it:

$excludedImages = new Varien_Data_Collection();
$images = $product->getMediaGallery('images');
foreach ($images as $image)
    if ($image['disabled'])
        $image['url'] = $product->getMediaConfig()->getMediaUrl($image['file']);
        $image['id'] = isset($image['value_id']) ? $image['value_id'] : null;
        $image['path'] = $product->getMediaConfig()->getMediaPath($image['file']);
        $excludedImages->addItem(new Varien_Object($image));

Now the $excludedImages collection contain every excluded images.

  • Thanx man, it helped me.. :-) – Shafeeque S Feb 10 '16 at 12:53

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.