using group() breaks getSelectCountSql in magento

后端 未结 5 530
无人及你
无人及你 2020-12-08 05:50

When I\'m using

$collection->getSelect()->group(\'entity_id\')

or

$collection->groupByAttribute(\'entity_id\')
<         


        
5条回答
  •  死守一世寂寞
    2020-12-08 06:29

    I have solved this using the function below:

    public function getSize()
    {
        return sizeof( $this->getAllIds());
    }
    

    This helped me in issue of getSize() returning 1 count of product collection in Magento CE 1.5.

    I have overwritten the Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection file and place above function.

提交回复
热议问题