4

I'm working on a Magento store where there are lots of products with custom options. I noticed that when I sort category products by price, the displayed value (e.g. 300,00 EUR) is different from the one Magento uses to sort.

I'll try to explain...

  1. Product 1: price 100 EUR
  2. Product 2: price 90 EUR + 1 required custom option 20 EUR
  3. Product 3: price 130 EUR

I would like to see this sort ordeR:

  1. Product 2: 90 EUR
  2. Product 1: 100 EUR
  3. Product 3: 130 EUR

But I see:

  1. Product 2: 100 EUR
  2. Product 1: 90 EUR
  3. Product 3: 130 EUR

Is this the default Magento behavior? can I configure that from the backend area?

Thanks!

5

Yes, Magento sorts by the minimum price, which is stored in the price index table and takes required options into account.

In the default theme you should actually see "as low as 110 EUR" in the product list. To sort by product price alone, not minimum price, you would have to implement your own sort function.

Solution:

A solution without custom code would be to create a new attribute sort_price, make it sortable and enter the price that should be used for sorting for every product.

  • yes, @fschmengler,i am agree with you. – Amit Bera Jun 30 '15 at 6:51
  • You have remove my edit: :) – Amit Bera Jun 30 '15 at 7:10
  • I improved it :P – Fabian Schmengler Jun 30 '15 at 7:50
  • 1
    Thanks @fschmengler ! I decided to override the Product Resource Collection class to sort by "final_price" instead of "min_price". – Fabrizio D'Ammassa Jul 2 '15 at 6:04

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.