Collection
protected function _getProductCollection()
{
$tagModel = $this->tagTagFactory->create();
$this->_productCollection = $this->_productCollection
->addAttributeToSelect($this->_catalogConfig->getProductAttributes())
->addTagFilter($this->getTag()->getId())
->addStoreFilter($this->_storeManager->getStore()->getId())
// ->addMinimalPrice()
->addUrlRewrite()
->setActiveFilter();
$this->_productCollection->addAttributeToFilter('status', ['in' =>
$this->_productStatus->getVisibleStatusIds()]);
$this->_productCollection->setVisibility($this->_productVisibility->getVisibleInSiteIds());
return $this->_productCollection;
}
I am trying to get $this->_productCollection->getSize() which doesnot reflect proper result.
->addTagFilter($this->getTag()->getId())
and check ` $this->_productCollection->getSize()` give proper value and or use$this->_productCollection->count()
getting proper data