fahjblffela
New Member
I have a block on my front page that is grabbing the two newest products with a custom product image called \[code\]image_feature_front_right\[/code\]. I use this code as the query:\[code\]$_helper = $this->helper('catalog/output');$_productCollection = Mage::getModel("catalog/product")->getCollection();$_productCollection->addAttributeToSelect('*');$_productCollection->addAttributeToFilter("image_feature_front_right", array("notnull" => 1));$_productCollection->addAttributeToFilter("image_feature_front_right", array("neq" => 'no_selection'));$_productCollection->addAttributeToSort('updated_at', 'DESC');$_productCollection->setPageSize(2);\[/code\]I am able to get:
- the image: \[code\]echo $this->helper('catalog/image')->init($_product, 'image_feature_front_right')->directResize(230,315,4)\[/code\]
- the product url: \[code\]echo $_product->getProductUrl()\[/code\]
- the product name: \[code\]$this->stripTags($_product->getName(), null, true)\[/code\]