Results 1 to 10 of 147

Hybrid View

  1. #1
    Join Date
    Nov 2010
    Location
    Los Angeles, Ca
    Posts
    5
    Plugin Contributions
    0

    Default Re: Set number of products displayed per page (support thread)

    kid,
    what version of zen are you using? where did you replace the $max_results= ??

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Set number of products displayed per page (support thread)

    Small point:

    elseif($step = 'All') {

    should be

    elseif($step == 'All') {


    And really, the logic seems odd...
    If $step is '6', neither part will be executed, and if $step is 'All", it will not be '6' and only the first part will be executed. The second part can never be executed.
    Last edited by gjh42; 18 Nov 2010 at 03:32 AM.

  3. #3
    Join Date
    Dec 2008
    Posts
    25
    Plugin Contributions
    0

    Default Re: Set number of products displayed per page (support thread)

    Hi Guys

    We are using v1.3.9h

    The max display comes from:

    includes/functions/extra_functions/max_display.php

    It is the same kind of module as http://www.zen-cart.com/index.php?ma...roducts_id=716

    Thanks for your help

  4. #4
    Join Date
    Nov 2010
    Location
    Los Angeles, Ca
    Posts
    5
    Plugin Contributions
    0

    Default Re: Set number of products displayed per page (support thread)

    in my includes/functions/extra_functions/ i do not have a max_display.php file. is that where you input the $max_results line? the instructions say to edit /includes/modules/YOUR_TEMPLATE/product_listing.php am I missing something/don't know how to read? let me know.

    Thanks

  5. #5
    Join Date
    Dec 2008
    Posts
    25
    Plugin Contributions
    0

    Default Re: Set number of products displayed per page (support thread)

    Sorry, I am using an older version of this module, all thats different is the name of the files. The file in the new version is named set_num_products.php. both the new and old module use $max_display

    the original code that came with the module is below:

    Code:
    	$result .= '<a href="'.zen_href_link($page, zen_get_all_get_params(array('max_display',$listing_page_name)))."&amp;max_display=$max_display".'">'.$step.'</a> ';
    and I am trying to turn the links into images with the following code:

    Code:
    if($step != '6') {
    $result .= '<a href="'.zen_href_link($page, zen_get_all_get_params(array('max_display',$listing_page_name)))."&amp;max_display=$max_display".'" title="Show All Products" style="text-align:center; margin-left:40px;"><img src="includes/templates/TEMPLATENAME/images/button_showall.png" width="150" height="20" alt="Show All Products" /></a> ';
    			
    			}  
    			
    elseif($step = 'All') {
    $result .= '<a href="'.zen_href_link($page, zen_get_all_get_params(array('max_display',$listing_page_name)))."&amp;max_display=$max_display".'" title="Show 6 Products" style="text-align:center; margin-left:40px;"><img src="includes/templates/TEMPLATENAME/images/button_show6.png" width="150" height="20" alt="Show 6 Products" /></a> ';
    	}
    	}
    but my intention with this is:

    1. When you arrive on the page, it is displayed as 6 prods per page and only the "Show All" button is displayed plus the page navigation i.e. 1 2 3 4 [Next >>]
    2. If the visitor clicks "Show All" the Image for "Show 6" is displayed
    3. If the Visitor is in "Show All" Mode, then the "Show 6" Button will display


    But I'm stuck. Any help much appreciated.

  6. #6
    Join Date
    Nov 2010
    Location
    Los Angeles, Ca
    Posts
    5
    Plugin Contributions
    0

    Default Re: Set number of products displayed per page (support thread)

    I understand that you are trying to put images instead of the text but how did you get it to work? how did you complete this step
    Edit /includes/modules/YOUR_TEMPLATE/product_listing.php with the following code

    Find:
    $max_results = (PRODUCT_LISTING_LAYOUT_STYLE=='columns' && PRODUCT_LISTING_COLUMNS_PER_ROW>0) ? (PRODUCT_LISTING_COLUMNS_PER_ROW * (int)(MAX_DISPLAY_PRODUCTS_LISTING/PRODUCT_LISTING_COLUMNS_PER_ROW)) : MAX_DISPLAY_PRODUCTS_LISTING;

    Replace by:
    $max_results = (PRODUCT_LISTING_LAYOUT_STYLE=='columns' && PRODUCT_LISTING_COLUMNS_PER_ROW>0) ? (PRODUCT_LISTING_COLUMNS_PER_ROW * (int)($_SESSION['product_listing_max_display']/PRODUCT_LISTING_COLUMNS_PER_ROW)) : $_SESSION['product_listing_max_display'];

    where did you find the $max_results line? there is no $ max_results in my Edit /includes/modules/YOUR_TEMPLATE/product_listing.php file.

  7. #7
    Join Date
    Dec 2008
    Posts
    25
    Plugin Contributions
    0

    Default Re: Set number of products displayed per page (support thread)

    I already have the following code in my override folder for product_listing.php

    $max_results = (PRODUCT_LISTING_LAYOUT_STYLE=='columns' && PRODUCT_LISTING_COLUMNS_PER_ROW>0) ? (PRODUCT_LISTING_COLUMNS_PER_ROW * (int)($_SESSION['product_listing_max_display']/PRODUCT_LISTING_COLUMNS_PER_ROW)) : $_SESSION['product_listing_max_display'];

    The module is working as it was intented to, but I want to change text links to images but only show the option relevant.

    i.e.
    if six products are displayed - show the "display all products" image only
    if all products displayed - show the "display 6 products" image only

 

 

Similar Threads

  1. v151 Option to select number of products displayed per page
    By DeeL in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 6 Mar 2013, 03:09 AM
  2. v151 Error after trying to install Set Number of products displayed
    By DeeL in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 8 Feb 2013, 07:08 AM
  3. Changing number of products displayed per category
    By dpet102 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 29 Jun 2009, 06:45 PM
  4. where to set number of products per page?
    By bronwen in forum Basic Configuration
    Replies: 1
    Last Post: 25 Jul 2007, 11:15 PM
  5. Allow user to set "Number of Products Per Page"?
    By yellow1912 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 12 Apr 2007, 10:59 PM

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