I used the following code for sorting on category page.

if($this->getCurrentOrder() =="latest_products")
       $collection->addAttributeToSort('significance', 'DESC')->getSelect()->order("e.entity_id desc");

In order to debug, I use following on my local instance but surprisingly there is no ORDER BY significance DESC in query as well

$collection->getSelect(); die;

This is my configuration settings

enter image description here


I faced similar kind of problem because I was working on category page product sorting. As I understand, you made custom product attribute significance for sorting. So please make you have set Used in Product Listing to Yes in your custom product attribute. It is one of the possible cause.

enter image description here

As I look your configuration setting, the reason is because you set the Use Flat Catalog Product to Yes. So you have to set Used in Product Listing to Yes.

I hope this will help

  • What a shame! I don't have any idea it is as much easy. THanKs mate you are the savior. – Muhammad Anas Apr 25 at 10:33

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.