Zen Cart Logo

list all products

Views: 4,048

Results 1 to 7 of 7
3 Aug 2007, 1:06 PM
#1
scarlet avatar

scarlet

Zen Follower

Join Date:
Jun 2004
Posts:
127
Plugin Contributions:
0

list all products

Is there a way to list all the products in one category, without pagination? I don't want to do it all the time, I just want them to be able to click on a page number to go to that page OR have an option to list them ALL on one page together like other carts do.

8 Aug 2007, 5:56 PM
#2
redpaint avatar

redpaint

New Zenner

Join Date:
Jun 2007
Posts:
10
Plugin Contributions:
0

Re: list all products

Hi,

Not sure if this has been posted somewhere else but I also needed something like this and I came up with the following:

In includes->modules->TEMPLATE->product_listing.php paste php if(!empty($_REQUEST['ShowAll'])){$max_results = $_REQUEST['ShowAll'];} Directly under php $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; Then in includes->templates->TEMPLATE->tpl_modules_product_listing.php paste something like this ```php
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
// REDPAINT MODIFICATION TO ACTIVATE SHOW ALL FUNCTIONALITY
if(!empty($_REQUEST['ShowAll'])){
$ShowAll = $_REQUEST['ShowAll'];
$QS = str_replace('ShowAll='.$ShowAll,'',$_SERVER['QUERY_STRING']);
print '<a href="'.$_SERVER['SCRIPT_NAME'].'?'.$QS.'">Show '.MAX_DISPLAY_PRODUCTS_LISTING.' Per Page</a>';
}else{
print '<a href="'.$_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING'].'&ShowAll='.$listing_split->number_of_rows.'">Show all</a> | ';
}
// END MODIFICATION
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~


Put the code directly after line 28 which should read ```php
<div id="productsListingListingTopLinks" class="navSplitPagesLinks forward"><?php 

It may not be the most eloquent solution but I hope this helps someone else.

8 Aug 2007, 6:16 PM
#3
redpaint avatar

redpaint

New Zenner

Join Date:
Jun 2007
Posts:
10
Plugin Contributions:
0

Re: list all products

Actually, you'll need to wrap the code with another if tag like so: ```php
if($listing_split->number_of_rows > MAX_DISPLAY_PRODUCTS_LISTING){
if(empty($_REQUEST['ShowAll'])){
print '<a href="'.$_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING'].'&ShowAll='.$listing_split->number_of_rows.'">Show all</a> | ';
}else{
$ShowAll = $_REQUEST['ShowAll'];
$QS = str_replace('ShowAll='.$ShowAll,'',$_SERVER['QUERY_STRING']);
print '<a href="'.$_SERVER['SCRIPT_NAME'].'?'.$QS.'">Show '.MAX_DISPLAY_PRODUCTS_LISTING.' Per Page</a>';
}
}

8 Aug 2007, 8:28 PM
#4
scarlet avatar

scarlet

Zen Follower

Join Date:
Jun 2004
Posts:
127
Plugin Contributions:
0

Re: list all products

Thank you so much! This worked like a charm....

17 Aug 2007, 1:48 PM
#5
redpaint avatar

redpaint

New Zenner

Join Date:
Jun 2007
Posts:
10
Plugin Contributions:
0

Re: list all products

No problem, glad to help.

:)

22 Mar 2011, 1:34 PM
#6
marypotter avatar

marypotter

New Zenner

Join Date:
May 2008
Location:
Virginia Beach, Virginia, United States
Posts:
52
Plugin Contributions:
0

Re: list all products

Has anyone gotten this to work for the lastest version of Zen Cart? It won't work for me and I'm assuming it's because names to things have changed and I don't know what I need to change to make it work. Help pleeeeaaase!

22 Mar 2011, 2:27 PM
#7
marypotter avatar

marypotter

New Zenner

Join Date:
May 2008
Location:
Virginia Beach, Virginia, United States
Posts:
52
Plugin Contributions:
0

Re: list all products

After exhaustive searching (this really has been five days of searching), I found this hack on the split_page_results.php that worked exactly how I needed it to! The thread is linked below:

http://www.zen-cart.com/forum/showthread.php?t=38551&page=4