I want to apply multiple price ranges on final price of product collection. I have tried below code.
$collection->addFinalPrice(); $collection->getSelect() ->where('price_index.final_price <= ' . $maxprice)- >where('price_index.final_price >= ' . $minprice);
But from above method i can only apply one range to it. Also price range is dynamic. It can be one or more than one. I found following solution regarding my problem
->addFieldToFilter('final_price', array(array('from'=>'0','to'=>'5000'), array('from'=>'15000','to'=>'20000')))
But addFieldToFilter is not working on $collection. Any help will be appreciated.