I can see $prices = array_map('floatval', $prices); in Mage_Catalog_Model_Layer_Filter_Price.

I was wondering if I could intval without creating my own block, etc..?

1 Answer 1


There is no event dispatched in the methods that use floatval (loadPrices, loadPreviousPrices, loadNextPrices) so you have to create your own model that rewrites these methods. All you need is a single model (so no blocks)

class [Namespace]_[Module]_Model_Catalog_Layer_Filter_Price 
    extends Mage_Catalog_Model_Layer_Filter_Price {
    public function loadPrices($limit, $offset = null, $lowerPrice = null, $upperPrice = null) {
        $prices = parent::loadPrices($limit, $offset, $lowerPrice, $upperPrice);
        if ($prices) {
            $prices = array_map('intval', $prices);
        return $prices;
    //do the same for loadPreviousPrices and loadNextPrices
  • I still didn't get the config.xml rewrite to work. weird. I'll keep trying variations... ;-)
    – user76568
    Mar 10, 2014 at 12:07

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.