svetaines1 Posted October 29, 2010 Share Posted October 29, 2010 Now Prestashop pagination works like this:1) « Previous 1 2 3 Next » (When category is loaded or user press link 1)2) « Previous 1 2 3 4 Next » (When user select 2 or 3 link)3) « Previous 2 3 4 Next » (When last link 4 is selected)Is it possible to modify pagination, in order what all pages always will be visible. No matter you select link 1, 2, .., last oneI think answer is somewhere here >{if $start!=$stop} </pre> <ul> {if $p != 1} {assign var='p_previous' value=$p-1} goPage($requestPage, $p_previous)}">« {l s='Previous'} {else} « {l s='Previous'} {/if} {if $start>3} goPage($requestPage, 1)}">1 ... {/if} {section name=pagination start=$start loop=$stop+1 step=1} {if $p == $smarty.section.pagination.index} {$p|escape:'htmlall':'UTF-8'} {else} goPage($requestPage, $smarty.section.pagination.index)}">{$smarty.section.pagination.index|escape:'htmlall':'UTF-8'} {/if} {/section} {if $pages_nb>$stop+2} ... goPage($requestPage, $pages_nb)}">{$pages_nb|intval} {/if} {if $pages_nb > 1 AND $p != $pages_nb} {assign var='p_next' value=$p+1} goPage($requestPage, $p_next)}">{l s='Next'} » {else} {l s='Next'} » {/if} </ul> <br> {/if Link to comment Share on other sites More sharing options...
rocky Posted October 29, 2010 Share Posted October 29, 2010 Change line 7 of pagination.php (in PrestaShop v1.3.2): $range = 2; /* how many pages around page selected */ By default, PrestaShop will display only 2 pages either side of the current page. Increase this to a bigger value so that all pages are displayed. Link to comment Share on other sites More sharing options...
svetaines1 Posted October 29, 2010 Author Share Posted October 29, 2010 Thank you rocky for such quick respond. I will try your solution and if everything will be ok, that topic will be maked as SOLVED I test your code. It works!one more time thank you mate! Link to comment Share on other sites More sharing options...
Timpet Posted March 15, 2011 Share Posted March 15, 2011 I know this topic is kinda old, but...I had this working at one point, but then i just discovered that it is back to where i started, im not sure but i think i changed back when updating to 1.3.6, range = 15 at our shop, but i stille have this issue. Link to comment Share on other sites More sharing options...
Never_give_up Posted September 4, 2011 Share Posted September 4, 2011 Prestashop Version 1.4.4 go to >>> classes > FrontController.php change line: $range = 2; /* how many pages around page selected */ Change number to how many pages you wish to show like this: $range = 15; /* how many pages around page selected */ Link to comment Share on other sites More sharing options...
kfedorov Posted December 17, 2011 Share Posted December 17, 2011 Hello, I wrote a small article with fixed pagination.tpl, but it's in Russian. http://blog.kfedorov...l-v-prestashop/ or simply use the code part highlighted yellow from that article. This is the code with fix + new code separated with spaces: {if $start!=$stop} <ul class="pagination"> {if $p != 1} {assign var='p_previous' value=$p-1} <li id="pagination_previous"><a href="{$link->goPage($requestPage, $p_previous)}">« {l s='Previous'}</a></li> {else} <li id="pagination_previous" class="disabled"><span>« {l s='Previous'}</span></li> {/if} {if $start-$range<$range} {section name=pagination_start start=1 loop=$start step=1} <li><a href="{$link->goPage($requestPage, $smarty.section.pagination_start.index)}">{$smarty.section.pagination_start.index|escape:'htmlall':'UTF-8'}</a></li> {/section} {/if} {if $start>3} <li><a href="{$link->goPage($requestPage, 1)}">1</a></li> <li class="truncate">...</li> {/if} {section name=pagination start=$start loop=$stop+1 step=1} {if $p == $smarty.section.pagination.index} <li class="current"><span>{$p|escape:'htmlall':'UTF-8'}</span></li> {else} <li><a href="{$link->goPage($requestPage, $smarty.section.pagination.index)}">{$smarty.section.pagination.index|escape:'htmlall':'UTF-8'}</a></li> {/if} {/section} {if $pages_nb>$stop+2} <li class="truncate">...</li> <li><a href="{$link->goPage($requestPage, $pages_nb)}">{$pages_nb|intval}</a></li> {/if} {if $stop+$range>$pages_nb-1} {section name=pagination_start start=$stop+1 loop=$pages_nb+1 step=1} <li><a href="{$link->goPage($requestPage, $smarty.section.pagination_start.index)}">{$smarty.section.pagination_start.index|escape:'htmlall':'UTF-8'}</a></li> {/section} {/if} {if $pages_nb > 1 AND $p != $pages_nb} {assign var='p_next' value=$p+1} <li id="pagination_next"><a href="{$link->goPage($requestPage, $p_next)}">{l s='Next'} »</a></li> {else} <li id="pagination_next" class="disabled"><span>{l s='Next'} »</span></li> {/if} </ul> {/if} 1 Link to comment Share on other sites More sharing options...
kfedorov Posted February 12, 2012 Share Posted February 12, 2012 I wrote my solution in english: http://dailypresta.com/2012/02/12/prestashop-pagination-tpl-template-tune-up/ and also welcome to DailyPresta. I hope to make this blog really interesting for Prestashop developers and users. Link to comment Share on other sites More sharing options...
loop54 Posted February 15, 2012 Share Posted February 15, 2012 thank you for your post, i will try it Link to comment Share on other sites More sharing options...
melfred13 Posted July 3, 2013 Share Posted July 3, 2013 can you please answer this , how can i do this pagination format < page 1 of 10 > view all> Link to comment Share on other sites More sharing options...
Recommended Posts