0

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

50-500 then how can get?

0

You can try below code

$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToFilter('price',array('from'=>$from,'to'=>$to));
1

Try below code:

$model = Mage::getModel('catalog/product')
            ->getCollection()
            ->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.

0
->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.