Which Variable Is Responsible For Pagination Page Count

We need to reduce the no of pages displayed on a category page, currently it displays from

<, 1, 2,3 ,4 ,5 ,6 ,7, > and we want to limit this to <, 1,2,3, > only. Can some guide which variable is responsible for this page counter generation.

We need to reduce the no of pages displayed on a category page, currently it displays from

<, 1, 2,3 ,4 ,5 ,6 ,7, > and we want to limit this to <, 1,2,3, > only. Can some guide which variable is responsible for this page counter generation.

The number pages depends on the total amount of products in a category and the Items per page value.

But at any point of time you dont display more than a specific number of page links even if there are thousands of products , so how can reduce the display and show at any point of time only say 3 pages . eg. < 20 , 21 , 22 >

But at any point of time you dont display more than a specific number of page links even if there are thousands of products , so how can reduce the display and show at any point of time only say 3 pages . eg. < 20 , 21 , 22 >

goto : design/backend/templates/common/pagination.tpl

{foreach from=$pagination.navi_pages item="pg" name="f_pg"}
                    {if $pg eq $pagination.current_page || $pg eq $pagination.current_page-1 || $pg eq $pagination.current_page+1}
                    
  • {if $smarty.foreach.f_pg.first && $pg > 1 } 1 {if $pg != 2} ... {/if} {/if} {if $pg != $pagination.current_page}{$pg}{else}{$pg}{/if} {if $smarty.foreach.f_pg.last && $pg < $pagination.total_pages} {if $pg != $pagination.total_pages-1} ... {/if}{$pagination.total_pages} {/if}
  • {/if} {/foreach}

    goto : design/backend/templates/common/pagination.tpl

    {foreach from=$pagination.navi_pages item="pg" name="f_pg"}
                        {if $pg eq $pagination.current_page || $pg eq $pagination.current_page-1 || $pg eq $pagination.current_page+1}
                        
  • {if $smarty.foreach.f_pg.first && $pg > 1 } 1 {if $pg != 2} ... {/if} {/if} {if $pg != $pagination.current_page}{$pg}{else}{$pg}{/if} {if $smarty.foreach.f_pg.last && $pg < $pagination.total_pages} {if $pg != $pagination.total_pages-1} ... {/if}{$pagination.total_pages} {/if}
  • {/if} {/foreach}

    Hi Vivek we need this for frontend and not backend.

    Hi Vivek we need this for frontend and not backend.

    Goto : design/themes/responsive/templates/common/pagination.tpl

    {foreach from=$pagination.navi_pages item="pg"} {if $pagination.current_page eq $pg || $pagination.current_page-1 eq $pg || $pagination.current_page+1 eq $pg} {if $pg != $pagination.current_page} {$pg} {else} {$pg} {/if} {/if} {/foreach}

    i hope it will help . if you have another theme then please pm me pagination.tpl code.

    app/functions/fn.common.php

    Please find the fn_generate_pagination function and change

    $deviation = ($area == 'A') ? 5 : 7;
    

    to

    $deviation = ($area == 'A') ? 5 : 3;
    

    then clear cache and check the result

    n

    app/functions/fn.common.php

    Please find the fn_generate_pagination function and change

    $deviation = ($area == 'A') ? 5 : 7;
    

    to

    $deviation = ($area == 'A') ? 5 : 3;
    

    then clear cache and check the result

    It didnot work

    app/functions/fn.common.php

    Please find the fn_generate_pagination function and change

    $deviation = ($area == 'A') ? 5 : 7;

    to

    $deviation = ($area == 'A') ? 5 : 3;

    then clear cache and check the result

    working . :)

    but for this view : <, 1,2,3, >

    use :

    $deviation = ($area == 'A') ? 5 : 1;

    n

    It didnot work

    Works for me also. Do not forget to clear cache

    Works for me now Thx Vivek

    use :

    $deviation = ($area == 'A') ? 5 : 1;

    welcome fleaffair