1
    $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')

对于 media_gallery_label 字段,我需要能够按任何图库图像进行过滤,并且如果任何图像的标签是“主页图像”,它需要显示而不是默认的“小”图像。我需要它只在 new.phtml 文件中工作,而不是在 list.phtml 中。

4

0 回答 0