I am currently trying to get products that are of a certain price range in Magento. I tried the first two logical ways I could think. The first one being to add two addAttributeToFilter() statements to my code.
$products->addAttributeToFilter('price', array('gteq' => $r['price_low'])); $products->addAttributeToFilter('price', array('lteq' => $r['price_high']));
No dice. This just gave me the second one.
Then what I decided to try was adding both conditionals to a single addAttributeToFilter() like this:
$price_array['gteq'] = $r['price_low']; $price_array['lteq'] = $r['price_high']; $products->addAttributeToFilter('price', $price_array);
Again just the high end. I did a getSelect() on my collection and confirmed it in the query that it is only applying the high end.
Does anyone know how I can get products that have a price range.