I am creating a website in magento.
So i have added a new media image attribute to my products. I want to use a specific image for my homepage but a few products will not have this image.
So i have created a new list.phtml file called list-homepage.phtml.
so i am doing this at the moment within product collection for loop in list.phtml.
$product=Mage::getModel('catalog/product')->load($_product->getId());
i am loading the product again from above, and i test to see if this product has the new image attribute
<?php if ($product->getMaleFemaleImage()){ ?>
<img src="<?php echo $this->helper('catalog/image')->init($product, 'male_female_image')->setQuality(100)->resize($imgSize); ?>" width="<?php echo $imgSize ?>" height="<?php echo $imgSize ?>" alt="<?php echo $this->stripTags($this->getImageLabel($product, 'male_female_image'), null, true) ?> " />
<?php }else{ ?>
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->setQuality(100)->resize($imgSize); ?>" width="<?php echo $imgSize ?>" height="<?php echo $imgSize ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
<?php }?>
This works BUT As you can see from above i have to load the product again and i do not want to do this. Is there any way to get access to the male_female_image attribute i have created.