Author Topic: Showing 20 - 40 - 60 - 80 - ALL products per page  (Read 2373 times)

Offline svsanchez

  • Newbie
  • *
  • Posts: 23
  • Karma: +1/-0
    • View Profile
Showing 20 - 40 - 60 - 80 - ALL products per page
« on: March 02, 2016, 10:12:28 PM »
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?

Offline svsanchez

  • Newbie
  • *
  • Posts: 23
  • Karma: +1/-0
    • View Profile
Re: Showing 20 - 40 - 60 - 80 - ALL products per page
« Reply #1 on: March 04, 2016, 01:12:15 AM »
I haven't yet figured how to do this. Is this possible?

Offline svsanchez

  • Newbie
  • *
  • Posts: 23
  • Karma: +1/-0
    • View Profile
Re: Showing 20 - 40 - 60 - 80 - ALL products per page
« Reply #2 on: March 05, 2016, 01:08:37 AM »
C'mon, is this really impossible to do?

Offline llegrand

  • Hero Member
  • *****
  • Posts: 1494
  • Karma: +390/-2
    • View Profile
Re: Showing 20 - 40 - 60 - 80 - ALL products per page
« Reply #3 on: March 05, 2016, 02:48:51 PM »
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.

 

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4153
  • Karma: +251/-9
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Showing 20 - 40 - 60 - 80 - ALL products per page
« Reply #4 on: March 05, 2016, 03:52:54 PM »
This is pretty easy to change.

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

Code: [Select]
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

Code: [Select]
$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




We need your help to build better free open source eCommerce platform for everyone.
See how you can help

Offline svsanchez

  • Newbie
  • *
  • Posts: 23
  • Karma: +1/-0
    • View Profile
Re: Showing 20 - 40 - 60 - 80 - ALL products per page
« Reply #5 on: March 15, 2016, 11:23:42 PM »
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!

Offline svsanchez

  • Newbie
  • *
  • Posts: 23
  • Karma: +1/-0
    • View Profile
Re: Showing 20 - 40 - 60 - 80 - ALL products per page
« Reply #6 on: March 16, 2016, 12:12:37 AM »
Never mind with my previous question: I found the way to do this in Admin > Settings > General

Thanks a lot!

 

Powered by SMFPacks Social Login Mod