Below is the sku filter apply to category product collection in function of Layer.php file,
-------------------------------------------------------------------------------------------------------------------
public function getProductCollection()
{
if (isset($this->_productCollections[$this->getCurrentCategory()->getId()])) {
$collection = $this->_productCollections[$this->getCurrentCategory()->getId()];
$collection->addAttributeToFilter('sku', ['in' => ['Demo3333','AD24FL600']]);
} else {
$collection = $this->collectionProvider->getCollection($this->getCurrentCategory());
$collection->addAttributeToFilter('sku', ['in' => ['Demo3333','AD24FL600']]);
$this->prepareProductCollection($collection);
$this->_productCollections[$this->getCurrentCategory()->getId()] = $collection;
}
return $collection;
}
-------------------------------------------------------------------------------------------------------------------
At frontstore category product listing page i got filter product.
But the problem in total count items and pagination,
like, category have 10 products and i have filtered out 2 products here.
still frontstore display items count 10 and pagination accordingly. but there is two items in list.
Anybody can help,
Thanks.