diff --git a/module/category/src/Persistence/Dbal/Query/DbalCategoryQuery.php b/module/category/src/Persistence/Dbal/Query/DbalCategoryQuery.php index 4a74f4bf9..dc38c4d5c 100644 --- a/module/category/src/Persistence/Dbal/Query/DbalCategoryQuery.php +++ b/module/category/src/Persistence/Dbal/Query/DbalCategoryQuery.php @@ -105,6 +105,6 @@ private function getQuery(): QueryBuilder return $this->connection->createQueryBuilder() ->addSelect('t.elements_count') ->from(self::CATEGORY_TABLE, 'c') - ->join('c', '(SELECT count(*) as elements_count, pcp.category_id FROM product_category_product pcp GROUP BY pcp.category_id)', 't', 't.category_id = c.id'); + ->leftJoin('c', '(SELECT count(*) as elements_count, pcp.category_id FROM product_category_product pcp GROUP BY pcp.category_id)', 't', 't.category_id = c.id'); } }