0

How to display exclude images on magento product view page. I'm using magento 1.9

  • Instead of showing excluded images, why not to changes the status exclude to not-exclude ? – Rahul Singh Jun 29 '18 at 9:45
  • or you want all images whether its exclude ot include to display on product view page?? right ? – Rahul Singh Jun 29 '18 at 9:47
  • Hi want to display particular product exclude images on separate div – user68853 Jun 29 '18 at 9:54
  • check the answer – Rahul Singh Jun 29 '18 at 9:56
  • it will show the both enable and disable images of image gallery, – Rahul Singh Jun 29 '18 at 9:57
0

To get all images of product including exclude images in magento , you can look at the Mage_Catalog_Model_Product, override this core file on local.

public function getMediaGalleryImages()
{
if(!$this->hasData('media_gallery_images') && is_array($this->getMediaGallery('images'))) {
$images = new Varien_Data_Collection();
foreach ($this->getMediaGallery('images') as $image) {
if ($image['disabled']) {
continue;
}
$image['url'] = $this->getMediaConfig()->getMediaUrl($image['file']);
$image['id'] = isset($image['value_id']) ? $image['value_id'] : null;
$image['path'] = $this->getMediaConfig()->getMediaPath($image['file']);
$images->addItem(new Varien_Object($image));
}
$this->setData('media_gallery_images', $images);
}

return $this->getData('media_gallery_images');

Magento media attribute a have field name disabled or exclude which tell which image are in excluded list check:

foreach (Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages() as $_image){
                if( $_image->getExclude()==1){
                $this->helper('catalog/image')->init($_product, 'thumbnail', $_image->getFile())->resize(301);
                }
            }
  • Thanks But i need only separate view for excluded product – user68853 Jun 29 '18 at 10:02
  • can I get the collection of every excluded images of that product ? from that you can show what you want – Rahul Singh Jun 29 '18 at 10:06
  • yes but i need to view every product excluded images on that particular product view page. I need to display like this global.rakuten.com/en/store/koreda/item/ts0040103908_15839 – user68853 Jun 29 '18 at 10:12
  • updated the answer – Rahul Singh Jun 29 '18 at 10:14
  • But it will fetch all excluded product form the db. i need based on product id – user68853 Jun 29 '18 at 10:21

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