I'm pretty new to Magento and I'm trying to figure out how to filter a collection of products. Here's the situation: I have a product that have a 'style', which is a product's attribute (example of style: brass). I need to get all other products that have the style 'brass'.
I've done a few research and discovered the addFieldToFilter() method, but it doesn't seem to be working (or, most likely, I'm not using it properly):
$same_style_collection = Mage::getModel('catalog/product')->getCollection()
->addFieldToFilter(array(array('attribute' => 'name', 'like' => 'brass')));
Can anyone help me? It would be greatly appreciated.