32 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; ...
Qaisar Satti's user avatar
  • 32.5k
29 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: <?...
Chris's user avatar
  • 634
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 ...
Muhammad Hasham's user avatar
11 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 ...
Darin Minard's user avatar
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 ...
Amit Bera's user avatar
  • 77.5k
8 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; }
Nauman m. Mansuri's user avatar
7 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 ...
bassplayer7's user avatar
  • 2,196
7 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 ...
Nalin Savaliya's user avatar
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
Ronak Patel's user avatar
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 ...
Mageworx's user avatar
  • 3,796
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 ...
Manoj Deswal's user avatar
  • 5,785
5 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/...
Sepp's user avatar
  • 51
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 ...
Zachary Craig's user avatar
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 ...
Jaimin Sutariya's user avatar
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(); ...
Sohel Rana's user avatar
  • 35.8k
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, ...
Waqar's user avatar
  • 974
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 $...
Jackson's user avatar
  • 9,909
3 votes

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

All credits to Mr. Rakesh Jesadiya for this answer. As per question asked, I think following my answer can help you. -> There is a Build(...) in Magento\CatalogSearch\Model\Search\IndexBuilder.php ....
Kazim Noorani's user avatar
3 votes

Pagination (block) missing

To show toolbar please add below css .toolbar, .pager { display: block; }
Nalin Savaliya's user avatar
3 votes

Pagination (block) missing

The toolbar is being loaded, it just has a CSS style set to display: none; .toolbar, .pager { display: none; }
RichieJP81's user avatar
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 ...
mp196's user avatar
  • 602
3 votes

How can I hide the Paging in the Grid?

For magento 2, try below in construct method. protected function _construct() { parent::_construct(); $this->setId('postGrid'); $this->setDefaultSort('customer_prescription_id'); ...
Kazim Noorani's user avatar
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)...
Andrey Miasoedov's user avatar
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"/> ...
Prince Patel's user avatar
  • 22.7k
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....
Kanhaiya lal's user avatar
  • 1,548
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 $...
Shoaib Munir's user avatar
  • 9,414
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 ...
DPCO's user avatar
  • 31
2 votes
Accepted

Debug Magento speed - slow on 'All' products select

You can use the AOE Profiler module on GitHub. It will give you an accurate breakdown on how the page is loaded: Once you find the problem area you can investigate further.
SR_Magento's user avatar
  • 5,209
2 votes

Pagination and Sorting not working

Use below snippet to add pagination and sorting on your custom collection. For every custom collection listing you have to create custom toolbar pager as well. $itemsLimit = $_GET["...
Ahsan Horani's user avatar
2 votes
Accepted

Magento pagination not working with custom objects

once the elements are loaded there is no way to paginate them, because when you later go through foreach ($collection as $item) you iterate through all the items. If you want a pagination in this case ...
Marius's user avatar
  • 198k

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