Showing 20 - 40 - 60 - 80 - ALL products per page

Started by svsanchez, March 02, 2016, 10:12:28 PM

Previous topic - Next topic

svsanchez

Hello, apparently my cart has the following displaying options by default:

5 - 15 - 25 - 35 - 45

Problem is that it displays 4 products per row, so the last row only shows 1 product, which makes the user think that's the last product (even with the NEXT link below). So I would like to offer the users the following displaying options instead:

20 - 40 - 60 - 80 - ALL

How can I do this?

svsanchez

I haven't yet figured how to do this. Is this possible?

svsanchez


llegrand

well here's a suggestion and a comment.

suggestion  -  just edit the language definitions - to let them know to look for more pages 
find it in the system > localization >language definitions  then type in Per page on the translate block and it will locate all instances for you.

comment -  personally I think showing all is not a good thing -  too much to load,  too much to scroll.


abantecart

This is pretty easy to change.

Default values are set in file: core/engine/html.php
Look for:
class PaginationHtmlElement extends HtmlElement {


public function __construct($data) {
parent::__construct($data);
//default settings
$this->sts['total'] = 0;
$this->sts['page'] = 1;
$this->sts['limit'] = 20;
$this->sts['split'] = 5;
$this->sts['limits'] = array();


These default settings will be overridden with params passed into pagination class in the controller.

In calling controller, for example in category listing: storefront/controller/pages/product/category.php


$this->view->assign('pagination_bootstrap', $this->html->buildElement( array (
'type' => 'Pagination',
'name' => 'pagination',
'text'=> $this->language->get('text_pagination'),
'text_limit' => $this->language->get('text_per_page'),
'total' => $product_total,
'page' => $page,
'limit' => $limit,
'url' => $pagination_url,
'style' => 'pagination'))


Add new param with 'limits' => array(20, 40, 60, 80),

This will split your pages with 20 per page




Please  rate your experience or leave your review
We need your help to build better free open source ecommerce platform for everyone. See how you can help

svsanchez

Hello abantecart, thanks a lot for your help, I was able to set the pagination in 20 items increments.

I would now like to show 50 products in the category page instead of the default 20. The reason for this is that many people don't see there are more products than the first 20. I tried changing the 'limit' line from 20 to 50 but this didn't work. Could you please tell me how to do this?

Thank you!

svsanchez

Never mind with my previous question: I found the way to do this in Admin > Settings > General

Thanks a lot!

Forum Rules Code of conduct
AbanteCart.com 2010 -