Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php
Original file line number Diff line number Diff line change
Expand Up @@ -1234,18 +1234,17 @@ public function getChildrenAmount($category, $isActiveFlag = true)
/**
* Get products count in category
*
* @param Mage_Catalog_Model_Category $category
* @param Mage_Catalog_Model_Category $category
* @return int
*/
public function getProductCount($category)
public function getProductCount(Mage_Catalog_Model_Category $category): int
{
$select = $this->_getReadAdapter()->select()
->from(
$this->getTable('catalog/category_product'),
"COUNT({$this->getTable('catalog/category_product')}.product_id)",
"COUNT({$this->getTable('catalog/category_product')}.product_id)"
)
->where("{$this->getTable('catalog/category_product')}.category_id = ?", $category->getId())
->group("{$this->getTable('catalog/category_product')}.category_id");
->where("{$this->getTable('catalog/category_product')}.category_id = ?", $category->getId());
return (int) $this->_getReadAdapter()->fetchOne($select);
}

Expand Down
Loading