Page 1 of 4 123 ... LastLast
Results 1 to 10 of 32
  1. #1
    Join Date
    Jan 2006
    Location
    Portugal
    Posts
    377
    Plugin Contributions
    1

    Number of Products per page...

    Hi Guys, I am trying to work out how to change the number of products displayed per page ? I know it is in Configuration >Maximum Values but which one is it that needs to be changed, I need it to display only 6 products per page.
    Any help would be great

    Cheers
    Dan.

  2. #2
    kelvyn Guest

    Default Re: Number of Products per page...

    I don't know, but I'd take a wild and crazy guess at
    "Products Listing- Number Per Page"

  3. #3
    Join Date
    Feb 2009
    Posts
    2
    Plugin Contributions
    0

    Default Re: Number of Products per page...

    It's in admin/config/max values/ PRODUCT LISTING-NUMBER PER PAGE.

    change that number to whatever you want. If you want all of your products in that category to show, simply type an insanely high number.

  4. #4
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Number of Products per page...

    Does anyone know how to modify ZC so that the customer can choose from a list, how many products per page to display? Or at least give them the option to click "show all" ?

    I have my All Products page set to display 32 products per page, but I'd like the customer to have different options.

  5. #5
    Join Date
    Mar 2006
    Location
    Fresno, California
    Posts
    620
    Plugin Contributions
    0

    Default Re: Number of Products per page...

    Hi limelites,

    There is a way to view all in a category. I did this about a year ago...

    http://www.zen-cart.com/forum/showth...t=38551&page=3

    see post #24 by modernm

    it involves editing product_listing.php and tpl_modules_product_listing.php

    it will give you a [view all] link in categories

  6. #6
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Number of Products per page...

    Thanks BobDog, that's a very useful link! I'm looking more at post 27 though as it seems this is the best working mod for all pages.

    My trouble is that I already have a modified split_page_results.php which is giving me my drop down page numbers.

    I'm having a hard time merging my own file with the file in post 27.

    My file with the drop down mods:
    http://www.limelites.co.uk/includes/...ge_results.rar

    This new file which gives a view all option:
    http://www.limelites.co.uk/includes/...p.view_all.rar

    Can't get them to merge :-(

  7. #7
    Join Date
    Dec 2006
    Location
    Athens - Greece
    Posts
    71
    Plugin Contributions
    0

    Default Re: Number of Products per page...

    Quote Originally Posted by limelites View Post
    Thanks BobDog, that's a very useful link! I'm looking more at post 27 though as it seems this is the best working mod for all pages.

    My trouble is that I already have a modified split_page_results.php which is giving me my drop down page numbers.

    I'm having a hard time merging my own file with the file in post 27.

    My file with the drop down mods:
    http://www.limelites.co.uk/includes/...ge_results.rar

    This new file which gives a view all option:
    http://www.limelites.co.uk/includes/...p.view_all.rar

    Can't get them to merge :-(
    Thanks limelites!
    Your drop-down mod works great!

  8. #8
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Number of Products per page...

    You're welcome.

    Oh and by the way, for anyone interested, the merged version which gives both the drop down for page numbers AND the choice to choose how many products per page (in my case 100, 200, 300, 400, View All) here is the split page file for /includes/classes:

    http://www.limelites.co.uk/split_page_results.rar

    You'll also need the define file added to /includes/languages/english/extra_definitions:

    http://www.limelites.co.uk/alternative_page_numbers.rar

    View it in action first at http://www.limelites.co.uk/index.php...e=products_all

  9. #9
    Join Date
    Oct 2009
    Posts
    30
    Plugin Contributions
    0

    Default Re: Number of Products per page...

    Quote Originally Posted by limelites View Post
    This mod is great but it's giving me problems.
    The drop down select for what page to jump too only works for the bottom "productsListingBottomNumber" page select under the product listing. The "productsListingTopNumber" page select drop down before the product listing does not work.

    The Prev and Next buttons work on top and bottom fine.
    Problem is only the top drop down for which page to jump too.
    When you select a different page it stays on the same page.

    A great mod that would be super for my site because we have very large categories. Sadly I dont know enough php to spot the problem.
    I am using 1.3.9b. w/ no conflicting addons (already checked).
    php 4.4.7

    Thank you for any help!

    Here is Limelites code:
    PHP Code:
    <?php
    /**
     * split_page_results Class.
     *
     * @package classes
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: split_page_results.php 3041 2006-02-15 21:56:45Z wilt $
     */
    if (!defined('IS_ADMIN_FLAG')) {
      die(
    'Illegal Access');
    }
    /**
     * Split Page Result Class
     * 
     * An sql paging class, that allows for sql reslt to be shown over a number of pages using  simple navigation system
     * Overhaul scheduled for subsequent release
     *
     * @package classes
     */
    class splitPageResults extends base {
      var 
    $sql_query$number_of_rows$current_page_number$number_of_pages$number_of_rows_per_page$page_name;

      
    /* class constructor */
      
    function splitPageResults($query$max_rows$count_key '*'$page_holder 'page'$debug false) {
        global 
    $db;

        
    $this->sql_query $query;
        
    $this->page_name $page_holder;

        if (
    $debug) {
          echo 
    'original_query=' $query '<br /><br />';
        }
        if (isset(
    $_GET[$page_holder])) {
          
    $page $_GET[$page_holder];
        } elseif (isset(
    $_POST[$page_holder])) {
          
    $page $_POST[$page_holder];
        } else {
          
    $page '';
        }

        if (empty(
    $page) || !is_numeric($page)) $page 1;
        
    $this->current_page_number $page;

        
    $this->number_of_rows_per_page $max_rows;

        
    $pos_to strlen($this->sql_query);

        
    $query_lower strtolower($this->sql_query);
        
    $pos_from strpos($query_lower' from'0);

        
    $pos_group_by strpos($query_lower' group by'$pos_from);
        if ((
    $pos_group_by $pos_to) && ($pos_group_by != false)) $pos_to $pos_group_by;

        
    $pos_having strpos($query_lower' having'$pos_from);
        if ((
    $pos_having $pos_to) && ($pos_having != false)) $pos_to $pos_having;

        
    $pos_order_by strpos($query_lower' order by'$pos_from);
        if ((
    $pos_order_by $pos_to) && ($pos_order_by != false)) $pos_to $pos_order_by;

        if (
    strpos($query_lower'distinct') || strpos($query_lower'group by')) {
          
    $count_string 'distinct ' zen_db_input($count_key);
        } else {
          
    $count_string zen_db_input($count_key);
        }
        
    $count_query "select count(" $count_string ") as total " .
        
    substr($this->sql_query$pos_from, ($pos_to $pos_from));
        if (
    $debug) {
          echo 
    'count_query=' $count_query '<br /><br />';
        }
        
    $count $db->Execute($count_query);

        
    $this->number_of_rows $count->fields['total'];

        
    $this->number_of_pages ceil($this->number_of_rows $this->number_of_rows_per_page);

        if (
    $this->current_page_number $this->number_of_pages) {
          
    $this->current_page_number $this->number_of_pages;
        }

        
    $offset = ($this->number_of_rows_per_page * ($this->current_page_number 1));

        
    // fix offset error on some versions
        
    if ($offset 0) { $offset 0; }

        
    $this->sql_query .= " limit " $offset ", " $this->number_of_rows_per_page;
      }

      
    /* class functions */

      
    function display_links($max_page_links,$parameters '') {
          if ( 
    zen_not_null($parameters) && (substr($parameters, -1) != '&') ) $parameters .= '&';
          
    $num_pages ceil($this->number_of_rows $this->number_of_rows_per_page);
          
    $pages_array = array();
          for (
    $i=1$i<=$num_pages$i++) {
            
    $pages_array[] = array('id' => $i'text' => $i);
          }

          if (
    $num_pages 1) {
            
    $display_links zen_draw_form('pages'zen_href_link($_GET['main_page']),'get') . zen_draw_hidden_field('main_page'$_GET['main_page']);

            if (
    $this->current_page_number 1) {
              
    $display_links .= '<a href="' zen_href_link($_GET['main_page'], $parameters $this->page_name '=' . ($this->current_page_number 1), 'NONSSL') . '" class="splitPageLink">' PREVNEXT_BUTTON_PREV '</a>&nbsp;&nbsp;';
            } else {
              
    $display_links .= PREVNEXT_BUTTON_PREV '&nbsp;&nbsp;';
            }

        
    $display_links .= sprintf('Page %s of &nbsp;%d'zen_draw_pull_down_menu($this->page_name$pages_array$this->current_page_number'onChange="this.form.submit();"'), $num_pages);

            if ((
    $this->current_page_number $num_pages) && ($num_pages != 1)) {
              
    $display_links .= '&nbsp;&nbsp;<a href="' zen_href_link($_GET['main_page'], $parameters $this->page_name '=' . ($this->current_page_number 1), 'NONSSL') . '" class="splitPageLink">' PREVNEXT_BUTTON_NEXT '</a>';
            } else {
              
    $display_links .= '&nbsp;&nbsp;' PREVNEXT_BUTTON_NEXT;
            }

            if (
    $parameters != '') {
              if (
    substr($parameters, -1) == '&'$parameters substr($parameters0, -1);
              
    $pairs explode('&'$parameters);
              while (list(, 
    $pair) = each($pairs)) {
                list(
    $key,$value) = explode('='$pair);
                
    $display_links .= zen_draw_hidden_field(rawurldecode($key), rawurldecode($value));
              }
            }

            if (
    SID$display_links .= zen_draw_hidden_field(zen_session_name(), zen_session_id());

            
    $display_links .= '</form>';
          } else {
            
    $display_links sprintf(TEXT_RESULT_PAGE$num_pages$num_pages);
          }
          return 
    $display_links;
        }  
      
    // display number of total products found
      
    function display_count($text_output) {
        
    $to_num = ($this->number_of_rows_per_page $this->current_page_number);
        if (
    $to_num $this->number_of_rows$to_num $this->number_of_rows;

        
    $from_num = ($this->number_of_rows_per_page * ($this->current_page_number 1));

        if (
    $to_num == 0) {
          
    $from_num 0;
        } else {
          
    $from_num++;
        }

        if (
    $to_num <= 1) {
          
    // don't show count when 1
          
    return '';
        } else {
          return 
    sprintf($text_output$from_num$to_num$this->number_of_rows);
        }
      }
    }
    ?>

  10. #10
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Number of Products per page...

    Can you post a link to your site please?

 

 
Page 1 of 4 123 ... LastLast

Similar Threads

  1. Replies: 3
    Last Post: 15 Oct 2013, 02:02 PM
  2. Reduce the number of products per page
    By Jhancy in forum General Questions
    Replies: 1
    Last Post: 1 Apr 2010, 08:56 AM
  3. increase number of products per page in admin
    By wolf99 in forum Customization from the Admin
    Replies: 3
    Last Post: 3 Nov 2009, 03:56 PM
  4. Number Of Products Per Page
    By godspeed128 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 21 Apr 2009, 04:43 AM
  5. Number of products per page
    By ryanb4614 in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 17 Mar 2008, 05:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg