View Single Post
  #41  
Old 09-21-2008, 06:30 PM
 
glsp glsp is offline
 

Member
  
Join Date: Dec 2007
Location: Northampton, MA
Posts: 27
 

Default Re: Show All Products in Catagory

Here is what I ended up using in init.php:
PHP Code:
#
# Show All Mod (Based on mod by Westin Shafer for Beach Bums Inc.)
#
if ($show $_GET['show']){
    
$config['Appearance']['products_per_page'] = $show;
    
$smarty->assign('show',$show);
        
}
# End Show All 

I removed the {if $total_pages gt 2} condition in subcategories.tpl so navigation.tpl would always load. Then I put this at the end of navigation.tpl, after the last {/if}:
Code:
{* View All mod *} {if $usertype eq 'C' && $products && $smarty.server.PHP_SELF ne '/manufacturers.php' && $smarty.server.PHP_SELF ne '/orders.php' } {if $show ne ''} <a href="{$navigation_script}">{$lng.lbl_View_paged}</a> {elseif $total_pages gt 2} <p class="NavigationTitle"><a href="{$navigation_script}&amp;show={$current_category.product_count}">{$lng.lbl_View_all} {$current_category.product_count} {$lng.lbl_products|lower}</a></p> {else} <span class="NavigationTitle">{$current_category.product_count} {$lng.lbl_products}</span> {/if} {else} <p /> {/if} {* End View All *}
Eventually, I would like to add a field where the customer can set a number of items to display on each page, but I couldn't figure out the session variables right away, and it's not high priority.
__________________
X-Cart Gold version 4.1.9

PS: This is what part of the alphabet would look like if Q and R were eliminated.
Reply With Quote