I am trying to get products using price range suppose we i want product with price range of

50-500 then how can get?


You can try below code

$collection = Mage::getModel('catalog/product')->getCollection();

Try below code:

$model = Mage::getModel('catalog/product')
            ->addFieldToFilter('price',array('from' => '50','to' => '500'))->getData();

    $productId = array();
    foreach($model as $key => $val) {
        foreach($val as $v) {
             $productId[$key] = $val['entity_id'];

Hope it helps.

->addAttributeToFilter('price', array(array('from'=>'0','to'=>'5000'), array('from'=>'15000','to'=>'20000')) )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.