- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2021
12:40 AM
03-22-2021
12:40 AM
Wrong pagination and count while applying attribute filter to category product collection page
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.
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.
Thanks.