1

I added the new product sorting attribute related to price in category page like price low to high and price high to low. It showed on Sort By drop down. It is working fine for configurable product and simple product but the problem is, it is working grouped products case.

Grouped product shows the price of their lowest simple product price in category page.

For Reference please see the screenshot

enter image description here

For Reference I use code for price sorting

$collection->getSelect()->order("price_index.final_price asc");

Any help, experience and knowledge sharing would be appreciated.

0

I resolved this sorting problem by using minimal_price instead of price_index.final_price.

It will work for product types including simple, configurable and Grouped

Here is code for that

//For Descending order
$collection->getSelect()->order("minimal_price desc");

//For Ascending order
$collection->getSelect()->order("minimal_price asc");

I hope this will help others who are facing a similar kind of sorting problem in category page/product listing page.

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.