Skip to content

pagination

Auto Added by WPeMatico

How do I return a 404 page for pagination pages where there are no products?

My website product landing pages have the current pagination: https://www.example.com/bread/sourdough https://www.example.com/bread/sourdough?p=2 But if I put in a page number that isn’t in the series, like: https://www.example.com/bread/sourdough?p=123123 Then I still get a live page with 0 products – essentially an empty… Read More »How do I return a 404 page for pagination pages where there are no products?

Pager not work in my custom collection?

I have a custom collection for ordered products for a customer. $connection = $this->resourceConnection->getConnection(MagentoFrameworkAppResourceConnection::DEFAULT_CONNECTION); $customerSession = $this->customerSession->create(); if ($customerSession->isLoggedIn()) { $customerId = $customerSession->getId(); $result1 = $connection->fetchAll(‘SELECT distinct(product_id) FROM `sales_order_item` as soi INNER join sales_order as so on so.entity_id=soi.order_id WHERE so.customer_id… Read More »Pager not work in my custom collection?

Issue with getting custom review collection based on product entity ids array with limited records

I am using this class to get review collection. MagentoReviewModelResourceModelReviewCollectionFactory I am using following function to get reviews collection based on product entity ids and my requirement is get only 50 reviews from all the available reviews. public function getReviewsCollection(){… Read More »Issue with getting custom review collection based on product entity ids array with limited records