문제

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top