//filter for products whose orig_price is greater than (gt) 100

$collection->addFieldToFilter(array(
array(‘attribute’=>’orig_price’,’gt’=>’100′),
));

//AND filter for products whose orig_price is greater than (lt) 130

$collection->addFieldToFilter(array(
array(‘attribute’=>’orig_price’,’lt’=>’130′),
));

//get products of configurable type

$storeId = Mage::app()->getStore()->getId();
$product = Mage::getModel(‘catalog/product’);
$product = Mage::getModel(‘catalog/product’);
$productsColor = $product->setStoreId($storeId)->getCollection()
->addAttributeToSelect(‘name’)
->addAttributeToFilter(‘type_id’, ‘configurable’)
->addAttributeToFilter(‘status’, ‘1’)
->addAttributeToSort(“name”, “ASC”)
->load();

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *