I have a category named "More" and it has 400 products in main store view, but in one sub store no products assigned from this category. But when I'm trying to get product count on sub store frontend for this category, it is returing 400 but it should be 0.
My code is as below :
$_category = $this->_categoryFactory->create();
$_category->load($id);
echo $category->getProductCount();
I also tried ->setStore($this->_storeManager->getStore())
but doesn't work.
How can I get correct product count on sub store view?