Show different product image in new.phtml vs. list
Posted
by
user1907662
on Stack Overflow
See other posts from Stack Overflow
or by user1907662
Published on 2012-12-16T10:29:01Z
Indexed on
2012/12/16
23:04 UTC
Read the original article
Hit count: 130
$collection = $this->_addProductAttributesAndPrices($collection)
->addStoreFilter()
->addAttributeToFilter('is_discontinued', array('neq' => 1) )
->addAttributeToFilter('collection_id', array('neq' => 'LKG') )
->addAttributeToFilter('media_gallery_label', array('eq' => 'Home Page Image') )
//->addAttributeToSort('entity_id', 'desc')
->addAttributeToSort('news_from_date', 'desc')
For the media_gallery_label field, I need to be able to filter by any gallery images, and if the label of any of the images is "Home Page Image", it needs to display instead of the default "small" image. I need this to work only in new.phtml file, and not in the list.phtml.
© Stack Overflow or respective owner