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..?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityThere 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
}
config.xml
rewrite to work. weird. I'll keep trying variations... ;-)
Mar 10, 2014 at 12:07