سؤال

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!

هل كانت مفيدة؟

المحلول

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى magento.stackexchange
scroll top