sort Magento collection AFTER load

后端 未结 5 1153
无人及你
无人及你 2020-12-09 07:02

The Magento collection sorting functions (e.g. Mage_Eav_Model_Entity_Collection_Abstract::addAttributeToSort) work by adding an ORDER BY clause to

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-09 07:27

    Here's a tip; A collection's clear method unsets it's loaded flag, it allows you to change the sort or filters and run the new query.

    I accidentally discovered it when answering load only configurable products.

提交回复
热议问题