Number of products per page

Hi,



Has anyone managed to import the admin feature of changing the number of items per pages, into the customer side?



Would like to be able to allow customers to choose the number of products to view at any time.

This would be very useful, as most people don’t have a problem as they have a high internet speed.



Can anybody help us out?

[quote name=‘Gobbo’]This would be very useful, as most people don’t have a problem as they have a high internet speed.



Can anybody help us out?[/QUOTE]



I am working on this Gobbo, unless someone has done it before.



I’m ‘hacking’ with the templates, so if any joy, I’ll post my findings here.

This has been discussed before but I don’t know if someone came up with a solution. May want to search for it.



High speed internet isn’t the issue. If you have tens of thousand of products and someone decides they want to pull everyone of them, you can be sure you will be getting a notice from your host due to server load and/or crash.

True, very true.

Looking forward to your results.



It looks like you’ll need to add the picker to:

skins/yourskin/customer/views/products/components/sorting.tpl



and then modify /controllers/customer/categories.php at line 73 to override the static products_per_page setting.



Glen

In 2.1.1 I have managed to add products per page to the pagination.



i have attached an image and a copy of the file which is placed in the following directory:

skins//customer/common_templates



John

Carrol, thank you, this is great.



Best regards,

I have enhanced the pagination a bit more and added prev/next buttons for the pages, a copy of the pagination.tpl is attached for those interested in it



John

Your contribution is much appreciated :), thank you.

[quote name=‘JohnCarroll’]I have enhanced the pagination a bit more and added prev/next buttons for the pages, a copy of the pagination.tpl is attached for those interested in it



John[/QUOTE]



Hi i tried copying the template but there are no changes to my page. I am using version 2.0.1

I tried copying the template but there is no changes in my website. using v2.0.1

First of all, thanks for the contribution! On my default 2.1.1 install, the layout of the “Items per page” button is wonky - see attached.



Glen

pagination_wonky.gif

I don’t see the attachments for the code referenced above. Is it still available? Thanks.

I'm using this in views/products/components/sorting.tpl:


Per page:
9 |
27 |
54 

I added the “if” statement so it displays only if there is more than 1 page of products in the set:


{if $pagination.total_pages > 1}
Per page:
9 |
27 |
54 
{/if}


It's a great addition to the cat pages.

I added this feature to my pages too. It works like a charm. All you have to do is add to the customer/views/products/components/sorting.tpl file the following:


```php



{$lang.items_per_page}: 

{capture name=“tools_list”}



{/capture}



{if !isset($smarty.session.items_per_page)}{assign var=“my_items_per_page” value=“9” }{else}{assign var=“my_items_per_page” value=$smarty.session.items_per_page }{/if}



{include file=“common_templates/tools.tpl” tools_list=$smarty.capture.tools_list suffix=“items_per_page” link_text=$my_items_per_page no_link=true}

```

just above the:

```php

```

in the end of the file.

I use a "solitude" based theme so the above appears as a fancy pop-up box for choosing the number of products per page.

how it shows all products? Please help