how to filter all products by attribute value in magento

<?php
$vid = $_GET[‘id’];

$collection = Mage::getModel(‘catalog/product’)->getCollection()
->addAttributeToSelect(‘*’)
->addFieldToFilter(‘vendor’, array(‘eq’ => $vid));

foreach ($collection as $_product) {?>
<li class=”item-custom col-sm-3 pull-left” style=”height: 306px;”>

</div>

htmlEscape($_product->getName()) ?>

currency($_product->getFinalPrice(),true,false);
?>

getStore()->getId();
$summaryData = Mage::getModel(‘review/review_summary’)->setStoreId($storeId)->load($_product->getId());
?>

%;” class=”kksr-h1p-fuel kksr-h1p-star yellow”>

<span class=”inact”></span>
<span class=”inact”></span>
<span class=”inact”></span>
<span class=”inact”></span>
<span class=”inact”></span>
</div>

</div>

</div>

</div>

</div>

</li>
<?php }?>

Advertisements