31 votes
Accepted

how to add pagination on custom collection in Magento 2

get collection for that public function getNews() { //get values of current page $page=($this->getRequest()->getParam('p'))? $this->getRequest()->getParam('p') : 1; ...
  • 32.2k
19 votes
Accepted

After Upgrading to Magento 2.4.3 the pagination is not working anymore

I found the problem to exist in my overide file app/design/frontend/Vendor/Theme/Magento_Catalog/templates/product/list.phtml The original code in the bottom section of the page looked like this: <?...
  • 484
13 votes
Accepted

Magento 2 - All products page with layered navigation and pagination

I recently did the same sort of work. First you need to override Category block because you want the All products page just like category page. In order to, get more understanding check ...
10 votes
Accepted

Remove pagination from order listing in frontend customer account?

You can remove pagination from using the events layout_generate_blocks_after. Run an observer on these events and remove the block sales.order.history.pager from layout which is responsible for ...
  • 76k
9 votes
Accepted

Magento 2 Pagination not working on search results - Porto Theme

After messing around with this for a bit I think I found the issue. I'm by no means an expert or know much about Magento 2. I'm also on Magento 2.4.0 and on Porto 3.2.5(One update back). The Issue is ...
6 votes
Accepted

How to update category page with custom filters, and also layered navigation, Magento 2.1

I have found answer to my question To apply custom filter in category, please do as below 1] create custom SKU filter with the help of search_request.xml create search_request.xml file in ...
6 votes

How to disable pagination on mysite.com/checkout/cart/ page?

Follow this step Stores > Configuration > Sales > Checkout > Shopping Cart > Number of Items to Display Pager = 0
6 votes
Accepted

How to add pagination at top and bottom of the product page in magento 2

put css in less file: app/design/frontend/Vendor_Name/Theme_Name/Magento_Catalog/web/css/source/_module.less .toolbar-products .pages { display:block !important; }
5 votes
Accepted

magento front end pagination not working for custom table join query collection

the problem is the group by statement. Magento's pagination system does not play well withe group by statements. You will always get a wrong result for the number of items. You need to reset the ...
  • 196k
5 votes
Accepted

Changing paging options in admin grid

The Javascript that handles the amounts is in a different class: js/grid/paging/sizes.js. In that class, there is a list of options. There are two ways to do what you are going after. One approach is ...
  • 2,088
5 votes

Why is setPageSize() and setCurPag‌​e( ) functions not working with the collection created with \Magento\Framework\Data\CollectionFactory?

The main reason why the issue occurs is that the methods setPageSize and setCurPage are not applied in the load method. This method is called from the loadData one, that in turn, must be called in ...
  • 3,728
5 votes
Accepted

Hide item count and pagination from category page in Magento2

This is one way to hide limiter and count from listing Page, there can be others as well Update your extended toolbar.phtml file and Find it at your extended theme path or if not then copy from ...
  • 5,715
4 votes

Category Product Page Not displaying pagination

As you are having Sort By option that means you have <?php echo $this->getToolbarHtml() ?> in your list.phtml file. Check in the catalog.xml whether you have called xml for pagination. The ...
  • 3,554
4 votes
Accepted

How can I hide the Paging in the Grid?

In your grid class add this in the constructor: $this->setPagerVisibility(false);
  • 196k
4 votes
Accepted

Show different number of products in category page

The problem is that the LIMIT is calculated based on "page size" and "current page" immediately before the collection is loaded. See Mage_Eav_Model_Entity_Collection_Abstract::_loadEntities(): public ...
4 votes
Accepted

Magento custom pagination limit change

Set setAvailableLimit() as $pager->setAvailableLimit(array(4=>4,10=>10,20=>20,'all'=>'all')); // Now you can get 4 items in a page. i.e, The first element in the array will be set ...
4 votes

Magento SEO implement rel="prev" and rel="next" meta tags

I've found a workaround for magento2 to accomplish this, which I've published here, but for the sake of it being here should the gist go somewhere, I'll include the code below. Basically, we just ...
4 votes

How to get collection object from custom query result in pagination

The issue is related to Magento's Varien_Data_Collection It does not support pagination. As you can see an answer here and also a possible solution here You can always use a Model for getting ...
4 votes

Magento2: How to get total page number of category?

You need to set page limit and page number in collection. Try following way: $collection->setCurPage($current_page)->setPageSize(9); echo $current_page." of ".$collection->getLastPageNumber(); ...
  • 34.5k
4 votes

Magento2 : Pagination - jump to top of page

You can do it by using jquery, add the following script in phtml file. <script> require(['jquery', 'jquery/ui'], function($){ $(".class of your nav button").click(function() { $("html, ...
  • 976
3 votes

Create magento pagination in custom product collection inside phtml file

This code help me with issues with pagination toolbar: $toolbar = Mage::getBlockSingleton('catalog/product_list')->getToolbarBlock(); $toolbar->setCollection($_productCollection)...
3 votes

Pagination (block) missing

The toolbar is being loaded, it just has a CSS style set to display: none; .toolbar, .pager { display: none; }
3 votes

Pagination (block) missing

To show toolbar please add below css .toolbar, .pager { display: block; }
3 votes

Pagination count and collection display issue for custom collection

Ok so i had to changed the way i used to access from 2 tables to 1 table and it has resolved my issue but yes somehow i was able to manage to get pagination with two collection by merging them as ...
  • 602
3 votes
Accepted

Pagination Limit Need to make dynamic

class Index extends \Magento\Framework\View\Element\Template { protected $context; protected $scopeConfig; public function __construct(\Magento\Framework\View\Element\Template\Context $...
  • 9,543
3 votes
Accepted

Magento2 UI grid same column problem

Open mageplaza_helloworld_post_listing.xml at view/adminhtml/ui_component/mageplaza_helloworld_post_listing.xml Now replace <item name="update_url" xsi:type="url" path="mui/index/render"/> ...
  • 21.9k
3 votes

How to add pagination at top and bottom of the product page in magento 2

Goto your Theme folder and open this below given file if not exist please copy from your Parent Theme or from Magento_Catalog module. if you using LUMA copy for your theme then this file will exist....
  • 1,503
3 votes
Accepted

How to get current page number from url in Magento 2

you can use $this->getRequest()->getParam('p') to get page number. Either you are in .phtml or in controller this will work If it is not working for you then you can try this: protected $...
  • 8,958
3 votes

Collection getSize returns Zero

I found what is causing the problem, as described here https://github.com/magento/magento2/issues/29777 it is an ElasticSearch7/Magento2 issue. Take a look in vendor/magento/module-elasticsearch-7/...
  • 31
3 votes

After Upgrading to Magento 2.4.3 the pagination is not working anymore

OK, so I have done a little experimenting. I've amended the 2.4.3 toolbar.phtml code to include the missing 2 elements in the else statement (seemed like a logical thing to have included, just in case ...
  • 31

Only top scored, non community-wiki answers of a minimum length are eligible