2

In a category that's only listing grouped products with several associated products each, I'd like the price sorting to use the max_price. Seems like it's using the min_price by default.

Is there an admin option I'm missing, or would I need to go override a model for this?

Thanks!

4

You can override this method: Mage_Catalog_Model_Resource_Product_Collection::addAttributeToSort().
There is a section for price sorting:

if ($attribute == 'price' && $storeId != 0) {
    $this->addPriceData();
    $this->getSelect()->order("price_index.min_price {$dir}");
    return $this;
}  

Change min_price to max_price

  • 1
    Awesome! Thanks, Marius! Works like a charm. :) For those interested: In your config.xml just add the reference to <models><catalog_resource><rewrite><product_collection>... – oschloebe Apr 20 '13 at 19:49

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.