Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2013
    Location
    Eustis, Florida, United States
    Posts
    84
    Plugin Contributions
    0

    Default Error after trying to install Set Number of products displayed

    Tried to install "Set number of products displayed" and then white screen, Arghhhhhhhh!

    I copied files over then did this. I think I screwed up after adding the code to the files.

    Installation

    Run the sql patch included. You can copy the file content, go to "Admin->Tools->Install SQL Patches" and paste the query there.
    This will add an additional option into Admin->Configuration->Product Listing
    Simply RENAME all the folders named "YOUR_TEMPLATE" inside "includes" to your current template name.
    Upload all the folders and files
    Edit /includes/modules/YOUR_TEMPLATE/product_listing.php
    If you don't already have a modified product_listing.php in /includes/modules/YOUR_TEMPLATE/, then create one there first.
    If you already have one, merge these changes into it.

    Find:
    if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
    }

    Add below:
    // BOF Number of Items Per Page
    if(isset($_POST['max_display']) || isset($_GET['max_display'])) {
    $_SESSION['product_listing_max_display'] = (int)$_REQUEST['max_display'];
    } elseif (!isset($_SESSION['product_listing_max_display'])) {
    $_SESSION['product_listing_max_display'] = (int)MAX_DISPLAY_PRODUCTS_LISTING;
    }
    // EOF Number of Items Per Page

    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'];
    Edit /includes/templates/YOUR_TEMPLATE/templates/tpl_modules_product_listing.php

    Find (this fragment occurs twice, at the top and bottom of the displayed page):
    <?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?>

    and paste the following code segments under the fragments.

    For the first paste, at the top of the page add:
    <!--bof set num products -->
    <?php
    if (PRODUCT_LISTING_MAX_DISPLAY_STEPS !='') { ?>
    <div id="maxProductsListingTop" class="navSplitPagesResult forward"><?php echo TEXT_DISPLAY_STEPS_NUMBER_OF_PRODUCTS;
    echo draw_max_display($_GET['main_page'], $listing_split->page_name, (int)PRODUCT_LISTING_COLUMNS_PER_ROW, $listing_split->number_of_rows);
    ?>
    </div>
    <?php } ?>
    <!--eof set num products -->


    <!--bof set num products ( dropdown ) -->
    <?php if (PRODUCT_LISTING_MAX_DISPLAY_STEPS !='') { ?>
    <form>
    <select onchange="if (this.value) window.location.href=this.value">
    <option value="[Select One]">Products per Page
    <?php echo draw_max_display($_GET['main_page'], $listing_split->page_name, (int)PRODUCT_LISTING_COLUMNS_PER_ROW, $listing_split->number_of_rows); ?>
    </select>
    </form>
    <?php } ?>
    <!--eof set num products ( dropdown ) -->


    For the second paste, for the bottom of the page add:
    <!--bof set num products -->
    <?php
    if (PRODUCT_LISTING_MAX_DISPLAY_STEPS !='') { ?>
    <div id="maxProductsListingBottom" class="navSplitPagesResult forward"><?php echo TEXT_DISPLAY_STEPS_NUMBER_OF_PRODUCTS;
    echo draw_max_display($_GET['main_page'], $listing_split->page_name, (int)PRODUCT_LISTING_COLUMNS_PER_ROW, $listing_split->number_of_rows);
    ?>
    </div>
    <?php } ?>
    <!--eof set num products -->




    The log file says this.

    [08-Feb-2013 05:06:16 UTC] PHP Fatal error: Cannot redeclare draw_max_display() (previously declared in /home/content/78/10039978/html/coopstore/includes/functions/extra_functions/set_num_products.php:5) in /home/content/78/10039978/html/coopstore/includes/functions/extra_functions/set_num_products_dd.php on line 28


    My code knowledge is poor to say the least and that file wasn't even edited. I have tried restoring to a earlier time today but I get the same thing. Of course I just sent an email out telling everyone about the new store

    Hoping someone can help

  2. #2
    Join Date
    Jan 2013
    Location
    Eustis, Florida, United States
    Posts
    84
    Plugin Contributions
    0

    Default Re: Error after trying to install Set Number of products displayed

    Don't worry. I found the support thread for the mod.

  3. #3
    Join Date
    Jan 2013
    Location
    Eustis, Florida, United States
    Posts
    84
    Plugin Contributions
    0

    Default Re: Error after trying to install Set Number of products displayed

    I got rid of one of the last two files as the last poster suggested and it works now. After performing two restores which obviously didn't help as it wasn't deleting the files I put in. On that note I am off to bed!

 

 

Similar Threads

  1. Set number of products displayed per page (support thread)
    By yellow1912 in forum All Other Contributions/Addons
    Replies: 146
    Last Post: 2 Nov 2023, 12:50 AM
  2. Trying to use Attributes to set Color and Model Number simultaneously
    By Pronetiq in forum Setting Up Categories, Products, Attributes
    Replies: 9
    Last Post: 24 Nov 2010, 08:25 PM
  3. Featured Products Set Number of Columns and Number of Products to Display
    By Adrian88 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 29 Jan 2009, 11:30 PM
  4. Error 500 in admin after trying to install google checkout mod
    By thecookbookshop in forum Addon Payment Modules
    Replies: 0
    Last Post: 11 Sep 2008, 04:09 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR