File tree Expand file tree Collapse file tree 1 file changed +0
-39
lines changed
app/code/Magento/Catalog/Model/ResourceModel/Category Expand file tree Collapse file tree 1 file changed +0
-39
lines changed Original file line number Diff line number Diff line change @@ -566,45 +566,6 @@ public function getProductTable()
566
566
return $ this ->_productTable ;
567
567
}
568
568
569
- /**
570
- * Get products count using catalog_category_entity table
571
- *
572
- * @param Category $item
573
- * @param string $websiteId
574
- * @return int
575
- */
576
- private function getProductsCountFromCategoryTable (Category $ item , string $ websiteId ): int
577
- {
578
- $ productCount = 0 ;
579
-
580
- if ($ item ->getAllChildren ()) {
581
- $ bind = ['entity_id ' => $ item ->getId (), 'c_path ' => $ item ->getPath () . '/% ' ];
582
- $ select = $ this ->_conn ->select ();
583
- $ select ->from (
584
- ['main_table ' => $ this ->getProductTable ()],
585
- new \Zend_Db_Expr ('COUNT(DISTINCT main_table.product_id) ' )
586
- )->joinInner (
587
- ['e ' => $ this ->getTable ('catalog_category_entity ' )],
588
- 'main_table.category_id=e.entity_id ' ,
589
- []
590
- )->where (
591
- '(e.entity_id = :entity_id OR e.path LIKE :c_path) '
592
- );
593
- if ($ websiteId ) {
594
- $ select ->join (
595
- ['w ' => $ this ->getProductWebsiteTable ()],
596
- 'main_table.product_id = w.product_id ' ,
597
- []
598
- )->where (
599
- 'w.website_id = ? ' ,
600
- $ websiteId
601
- );
602
- }
603
- $ productCount = (int )$ this ->_conn ->fetchOne ($ select , $ bind );
604
- }
605
- return $ productCount ;
606
- }
607
-
608
569
/**
609
570
* Get query for retrieve count of products per category
610
571
*
You can’t perform that action at this time.
0 commit comments