I have an custom attribute on each product called 'sidebar' which is a yes/no option. All the products that are set to 'yes' I would like to appear inside a div I have in 3columns.phtml. All I want to display is:
- title
- image (hyperlinked)
- price
I tried the answer in https://stackoverflow.com/questions/1332742/magento-retrieve-products-with-a-specific-attribute-value just to get a basic idea of the query but this didn't work for me. I tried:
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToSelect('sidebar');
$collection->addAttributeToSelect('orig_price');
$collection->addFieldToFilter(array(
array('sidebar'=>'orig_price','eq'=>'yes'),
));
foreach ($collection as $product) {
//var_dump($product);
var_dump($product->getData());
}
Any help is appreciated