Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
custom filter of getLoadedProductCollection() function,
getSize() method does not give correct value
You can do it like this
$_productCollection = $_productCollection->addAttributeToFilter('name', array( array('like' => '%'.$search_txt.'%') ));
Clone the collection object
$clone = clone $_productCollection;
Get the total size from the clone.
Please Use -
$totalProduct = count($this->getCollection()->getData());
Required, but never shown