28

get collection for that public function getNews() { //get values of current page $page=($this->getRequest()->getParam('p'))? $this->getRequest()->getParam('p') : 1; //get values of current limit $pageSize=($this->getRequest()->getParam('limit'))? $this->getRequest()->getParam('limit') : 1; $...


13

It's actually quite simple. In the main block that calls your collection to render, add the following: protected function _prepareLayout() { parent::_prepareLayout(); $pager = $this->getLayout()->createBlock('page/html_pager', 'your.custom.blockname.pager') ->setCollection($this->getCollection()); //call your own collection ...


13

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 getCurrentCategory() function which set the current category to root category Path: app\code\Vendor\AllProducts\Block\Category\View.php <?php /** * Copyright © Magento, ...


9

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 pagination. events.xml code: Location app/code/{Vendor}/{Modulename}/etc/frontend/ <?xml version="1.0" encoding="UTF-8"?> <!-- /** * @author Amit Bera ...


9

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 with the results template file in the Porto Theme. Path: App/design/frontend/Smartwave/porto/Magento_CatalogSearch/templates/result.phtml Comparing it to the ...


7

A pagination is linked to a collection. To get the total number of pages use this: $collection->getLastPageNumber(); If you have a pagination block in your page you can get the last page number like this: $block->getLastPageNum();


6

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


6

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

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 group by in the select that calculates the total number of items. This can be achieved by adding the following method in the collection resource model for your ...


5

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 MyNamespace/MyModule/etc/search_request.xml <?xml version="1.0"?> <requests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...


5

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 to extend the Javascript class and the second is to set the options with XML. The Javascript approach has some advantages, which are described below, but for ...


5

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 case when the collection is not uploaded and when its items are called (the method getItems for example). This confusion usually occurs due to the fact that the ...


5

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 vendor app/design/frontend/vendor-name/theme-name/Magento_Catalog/templates/product/list/toolbar.phtml To hide limiter and count from listing Page comment these ...


4

In your grid class add this in the constructor: $this->setPagerVisibility(false);


4

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 xml should be as below <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml"> <...


4

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 function _loadEntities($printQuery = false, $logQuery = false) { if ($this->_pageSize) { $this->getSelect()->limitPage($this->...


4

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 the default limit for the collection (per page).


4

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 collection. EDIT One more reference to look at.


4

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(); Following line return last page number. For example: you have 10 page then it return 10. $collection->getLastPageNumber()


4

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, body").animate({ scrollTop: 0 }, "slow"); }); </script> use your nav button class like $(".nav_btn") or you can use following code in success event of ...


3

This is your problem: foreach($collection as $col). You are iterating the collection before the pagination can set the limit on the select. This will cause the collection to be loaded, and any modification to it after that has no effect. You can try to call this before your custom code: $this->setCollection($collection); ...


3

Hello call your create custom toolbar.phtml & call into grid view 1.Comment $this->getToolbarHtml() & add below code <?php echo $this->getToolbarBlock()->setTemplate('catalog/product/list/newtoolbar.phtml')->toHtml() ?> 2.Copy content from toolbar.phtml to newtoolbar.phtml (change as your requirement) app/design/frontend/(base ...


3

This code help me with issues with pagination toolbar: $toolbar = Mage::getBlockSingleton('catalog/product_list')->getToolbarBlock(); $toolbar->setCollection($_productCollection); $layout = Mage::getSingleton('core/layout'); $pager = $layout->createBlock('page/html_pager'); $toolbar->setChild('...


3

Your concept is slightly lacking. The query should be at least moved outside of the template into Block class. Then in the same class you can add something like this to solve your pagination issue: protected function _beforeToHtml() { $blockName = $this->getToolbarBlockName(); if (!$blockName) { $blockName = 'product_list_toolbar'; ...


3

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


3

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


3

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 below rather than using array_merge $page= ($this->getRequest()->getParam('p'))? $this->getRequest()->getParam('p') : 1; if($page == 1) { foreach($...


3

class Index extends \Magento\Framework\View\Element\Template { protected $context; protected $scopeConfig; public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig) { $this->context = $context; $this->scopeConfig = $scopeConfig; ...


3

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"/> </item> at line number 42 as per your code Replace <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> ...


3

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. app\design\frontend\VENDOR\THEME\Magento_Catalog\web\css\source\module\_toolbar.less In this file under @media-common at last add give css & when (@...


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