Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Show All Products in Catagory

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #31  
Old 05-31-2008, 08:58 PM
 
funkymonkey funkymonkey is offline
 

Advanced Member
  
Join Date: Mar 2003
Location: California, USA
Posts: 72
 

Default Re: Show All Products in Catagory

I had this coded into 4.1.9. Here's my customer/main/nav in case it helps.

Why is this still not standard in X-Cart?



{* $Id: navigation.tpl,v 1.14 2004/06/24 13:09:51 max Exp $ *}
{if $total_pages gt 2}
<TABLE cellpadding="0" border="0">
<TR height="14">
{if $view_all eq "N" or $view_all eq ""}
<TD nowrap><b><a href="{$navigation_script}&view_all=Y">View All</a></b>&nbsp;&nbsp;&nbsp;</TD>

{section name=page loop=$total_pages start=$start_page}
{if %page.first%}
{if $navigation_page gt 1}
<TD valign="middle"><A href="{$navigation_script}&page={math equation="page-1" page=$navigation_page}">&laquo;&nbsp;Previous</A>&nbsp;&nbsp;</TD>
{/if}
{/if}
{if %page.index% eq $navigation_page}
<TD align="center" title="{$lng.lbl_current_page}: #{%page.index%}">
<span style="color: #f14841;"><B>{%page.index%}</B></span>
</TD>
{else}
{if %page.index% ge 100}
{assign var="cell_width" value="23"}
{assign var="suffix" value="_wide"}
{else}
{assign var="cell_width" value="17"}
{assign var="suffix" value=""}
{/if}
<TD align="center"><A href="{$navigation_script}&page={%page.index%}" style="text-decoration: none" title="{$lng.lbl_page} #{%page.index%}">{%page.index%}</A></TD>
{/if}
{if %page.last%}
{else}
<TD align="center">&nbsp;|&nbsp;</TD>
{/if}
{if %page.last%}
{math equation="pages-1" pages=$total_pages assign="total_pages_minus"}
{if $view_all eq "N" or $view_all eq ""}
{if $navigation_page lt $total_super_pages*$config.Appearance.max_nav_page s}
<TD valign="middle">&nbsp;&nbsp;<A href="{$navigation_script}&page={math equation="page+1" page=$navigation_page}">Next&nbsp;&raquo;</A></TD>
{/if}
{/if}
{/if}
{/section}

</TR></TABLE>
<P>
{else}
<TD nowrap><b><a href="{$navigation_script}&view_all=N">View by Page</a></b>&nbsp;&nbsp;&nbsp;</TD>
</TR></TABLE>
<p>
{/if}
{/if}
Attached Files
File Type: tpl 4.1.9_customer_main_navigation.tpl (1.7 KB, 77 views)
__________________
X-Cart Version: 4.4.1
Web Server: Unix
Operating System: Linux
Location: California, U.S.A.
Reply With Quote
  #32  
Old 06-02-2008, 08:38 AM
 
EN4U EN4U is offline
 

eXpert
  
Join Date: Feb 2008
Location: AZ
Posts: 379
 

Default Re: Show All Products in Catagory

Quote:
Originally Posted by funkymonkey
I had this coded into 4.1.9. Here's my customer/main/nav in case it helps.

Why is this still not standard in X-Cart?



{* $Id: navigation.tpl,v 1.14 2004/06/24 13:09:51 max Exp $ *}
{if $total_pages gt 2}
<TABLE cellpadding="0" border="0">
<TR height="14">
{if $view_all eq "N" or $view_all eq ""}
<TD nowrap><b><a href="{$navigation_script}&view_all=Y">View All</a></b>&nbsp;&nbsp;&nbsp;</TD>

{section name=page loop=$total_pages start=$start_page}
{if %page.first%}
{if $navigation_page gt 1}
<TD valign="middle"><A href="{$navigation_script}&page={math equation="page-1" page=$navigation_page}">&laquo;&nbsp;Previous</A>&nbsp;&nbsp;</TD>
{/if}
{/if}
{if %page.index% eq $navigation_page}
<TD align="center" title="{$lng.lbl_current_page}: #{%page.index%}">
<span style="color: #f14841;"><B>{%page.index%}</B></span>
</TD>
{else}
{if %page.index% ge 100}
{assign var="cell_width" value="23"}
{assign var="suffix" value="_wide"}
{else}
{assign var="cell_width" value="17"}
{assign var="suffix" value=""}
{/if}
<TD align="center"><A href="{$navigation_script}&page={%page.index%}" style="text-decoration: none" title="{$lng.lbl_page} #{%page.index%}">{%page.index%}</A></TD>
{/if}
{if %page.last%}
{else}
<TD align="center">&nbsp;|&nbsp;</TD>
{/if}
{if %page.last%}
{math equation="pages-1" pages=$total_pages assign="total_pages_minus"}
{if $view_all eq "N" or $view_all eq ""}
{if $navigation_page lt $total_super_pages*$config.Appearance.max_nav_page s}
<TD valign="middle">&nbsp;&nbsp;<A href="{$navigation_script}&page={math equation="page+1" page=$navigation_page}">Next&nbsp;&raquo;</A></TD>
{/if}
{/if}
{/if}
{/section}

</TR></TABLE>
<P>
{else}
<TD nowrap><b><a href="{$navigation_script}&view_all=N">View by Page</a></b>&nbsp;&nbsp;&nbsp;</TD>
</TR></TABLE>
<p>
{/if}
{/if}

Thanks..But a copy and paste into the new version of xcart doesnt appear to work.....

got this error

Parse error: syntax error, unexpected T_STRING in
__________________
Regards, Dan
X-Cart Gold Version 4.1.10

1 - One page checkout
2 - Image Generator
3 - CSDEO Pro
4 - Shop By Price
5 - Next - Previous
6 - On Sale
7 - Shop By Price

8 - Froogle & Google Base Feed
9 - Buy Together
10 - Customer Loyalty Points
11 - Customer Reward Points
Customer Reward Points Referral Add-on
12 - Product Reviews
13 - Other Custom Modifications
----------------------
http://www.townsqjewelry.com/
http://www.eroticnights4u.com/ <---- Adult Oriented - Toys
Reply With Quote
  #33  
Old 06-02-2008, 12:59 PM
 
yuichi yuichi is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 42
 

Default Re: Show All Products in Catagory

I am having the same issue. I have 4.1.9 and it does not work...
Anyone who had success in 4.1.9??
__________________
X-Cart Ver: 4.1.9 Gold
X-Cart Ver: 4.1.10 Gold
Reply With Quote
  #34  
Old 06-13-2008, 08:50 AM
 
effour effour is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 96
 

Default Re: Show All Products in Catagory

Post #1 works great in 4.1.7

For the 'view all' button, i simply used:
<a href="{$navigation_script}&amp;show=all">View All</a>
__________________
4.1.7
Reply With Quote
  #35  
Old 06-15-2008, 12:00 AM
 
pcparts pcparts is offline
 

Advanced Member
  
Join Date: Jul 2006
Location: Aussie
Posts: 85
 

Default Re: Show All Products in Catagory

I have this working good on 4.1.1.0.

This is our navigation.tpl file.

Code:
{* $Id: navigation.tpl,v 1.16.2.1 2006/06/16 10:47:41 max Exp $ *} {assign var="navigation_script" value=$navigation_script|amp} {if $total_pages gt 2} <table cellpadding="0"> <tr> <td class="NavigationTitle">{$lng.lbl_result_pages}:</td> {** View All Add on **} {if $smarty.server.PHP_SELF ne '/manufacturers.php' && $smarty.server.PHP_SELF ne '/admin/orders.php' && $smarty.server.PHP_SELF ne '/orders.php' } <td><a href="{$navigation_script}&amp;show=all">View All</a> |</td> {/if} {** End View All**} {if $current_super_page gt 1} <td><a href="{$navigation_script}&amp;page={math equation="page-1" page=$start_page}"><img src="{$ImagesDir}/larrow_2.gif" class="NavigationArrow" alt="{$lng.lbl_prev_group_pages|escape}" /></a></td> {/if} {section name=page loop=$total_pages start=$start_page} {if %page.first%} {if $navigation_page gt 1} <td valign="middle"><a href="{$navigation_script}&amp;page={math equation="page-1" page=$navigation_page}"><img src="{$ImagesDir}/larrow.gif" class="NavigationArrow" alt="{$lng.lbl_prev_page|escape}" /></a>&nbsp;</td> {/if} {/if} {if %page.index% eq $navigation_page} <td class="NavigationCellSel" title="{$lng.lbl_current_page|escape}: #{%page.index%}">{%page.index%}</td> {else} {if %page.index% ge 100} {assign var="suffix" value="Wide"} {else} {assign var="suffix" value=""} {/if} <td class="NavigationCell{$suffix}"><a href="{$navigation_script}&amp;page={%page.index%}" title="{$lng.lbl_page|escape} #{%page.index%}">{%page.index%}</a><img src="{$ImagesDir}/spacer.gif" alt="" /></td> {/if} {if %page.last%} {math equation="pages-1" pages=$total_pages assign="total_pages_minus"} {if $navigation_page lt $total_super_pages*$config.Appearance.max_nav_pages} <td valign="middle">&nbsp;<a href="{$navigation_script}&amp;page={math equation="page+1" page=$navigation_page}"><img src="{$ImagesDir}/rarrow.gif" class="NavigationArrow" alt="{$lng.lbl_next_page|escape}" /></a></td> {/if} {/if} {/section} {if $current_super_page lt $total_super_pages} <td><a href="{$navigation_script}&amp;page={math equation="page+1" page=$total_pages_minus}"><img src="{$ImagesDir}/rarrow_2.gif" class="NavigationArrow" alt="{$lng.lbl_next_group_pages|escape}" /></a></td> {/if} </tr> </table> {if $usertype ne "C"}<p />{/if} {/if}


And did the same as post 1 mentioned in the init.php file.

Locate this section in the init.php around line #329:
Code:
Code:
# # Read config variables from Database # This variables are used inside php scripts, not in smarty templates # $c_result = db_query("SELECT name, value, category FROM $sql_tbl[config] WHERE type != 'separator'"); $config = array(); if ($c_result) { while ($row = db_fetch_row($c_result)) { if (!empty($row[2])) $config[$row[2]][$row[0]] = $row[1]; else $config[$row[0]] = $row[1]; } }


Add this right after the closing if statment:

Code:
Code:
# # Show All Mod By Westin Shafer for Beach Bums Inc. # if ($_GET['show'] == 'all'){ $config['Appearance']['products_per_page'] = 500; }

Greg
__________________
Greg
X-CART Gold 4.1.10
Reply With Quote
  #36  
Old 06-15-2008, 06:08 AM
 
yuichi yuichi is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 42
 

Default Re: Show All Products in Catagory

Thanks pcparts!
I tried your code and it all worked! Thanks again!
__________________
X-Cart Ver: 4.1.9 Gold
X-Cart Ver: 4.1.10 Gold
Reply With Quote
  #37  
Old 07-01-2008, 01:31 PM
  WhiteDoveGifts's Avatar 
WhiteDoveGifts WhiteDoveGifts is offline
 

X-Adept
  
Join Date: Oct 2006
Location: Maarssen, The Netherlands
Posts: 474
 

Default Re: Show All Products in Catagory

Great mod, thanks for coding! Works fine with me on 4.1.10 and was easy to install
__________________
____________________________
X-Cart Gold 4.1.10

EWD Hosting | CDSEO Pro | One Page Checkout | Smart Search | Telafirma Dynamic Images | X-AOM | Product Importer Pro and many custom mods and tweaks found here...
Reply With Quote
  #38  
Old 07-01-2008, 01:56 PM
 
EN4U EN4U is offline
 

eXpert
  
Join Date: Feb 2008
Location: AZ
Posts: 379
 

Default Re: Show All Products in Catagory

Damn almost worked..may have done something wrong.... Thee.navigation.tpl went well as it showed View all at category page bottom...but the second part in the php file caused an error at the top of the page..... something about language or somethig.... maybe I placed it wrong.. this is where i put it...

#
# Read config variables from Database
# This variables are used inside php scripts, not in smarty templates
#
$c_result = db_query("SELECT name, value, category FROM $sql_tbl[config] WHERE type != 'separator'");
$config = array();
if ($c_result) {
while ($row = db_fetch_row($c_result)) {
if (!empty($row[2]))
$config[$row[2]][$row[0]] = $row[1];
else
$config[$row[0]] = $row[1];
}
}

Code:
# # Show All Mod By Westin Shafer for Beach Bums Inc. # if ($_GET['show'] == 'all'){ $config['Appearance']['products_per_page'] = 500; }


is that right?? This is when i got that error...
__________________
Regards, Dan
X-Cart Gold Version 4.1.10

1 - One page checkout
2 - Image Generator
3 - CSDEO Pro
4 - Shop By Price
5 - Next - Previous
6 - On Sale
7 - Shop By Price

8 - Froogle & Google Base Feed
9 - Buy Together
10 - Customer Loyalty Points
11 - Customer Reward Points
Customer Reward Points Referral Add-on
12 - Product Reviews
13 - Other Custom Modifications
----------------------
http://www.townsqjewelry.com/
http://www.eroticnights4u.com/ <---- Adult Oriented - Toys
Reply With Quote
  #39  
Old 07-01-2008, 11:39 PM
 
pcparts pcparts is offline
 

Advanced Member
  
Join Date: Jul 2006
Location: Aussie
Posts: 85
 

Default Re: Show All Products in Catagory

Try this mate in the init.php file.
Match it against yours.

PHP Code:
#
# Read config variables from Database
# This variables are used inside php scripts, not in smarty templates
#
$c_result db_query("SELECT name, value, category FROM $sql_tbl[config] WHERE type != 'separator'");
$config = array();
if (
$c_result) {
    while (
$row db_fetch_row($c_result)) {
        if (!empty(
$row[2]))
            
$config[$row[2]][$row[0]] = $row[1];
        else
            
$config[$row[0]] = $row[1];
    }
}
#
# Show All Mod By Westin Shafer for Beach Bums Inc.
#
if ($_GET['show'] == 'all'){
    
$config['Appearance']['products_per_page'] = 500;

__________________
Greg
X-CART Gold 4.1.10
Reply With Quote
  #40  
Old 07-02-2008, 12:51 AM
 
EN4U EN4U is offline
 

eXpert
  
Join Date: Feb 2008
Location: AZ
Posts: 379
 

Default Re: Show All Products in Catagory

Quote:
Originally Posted by pcparts
Try this mate in the init.php file.
Match it against yours.

PHP Code:
#
# Read config variables from Database
# This variables are used inside php scripts, not in smarty templates
#
$c_result db_query("SELECT name, value, category FROM $sql_tbl[config] WHERE type != 'separator'");
$config = array();
if (
$c_result) {
    while (
$row db_fetch_row($c_result)) {
        if (!empty(
$row[2]))
            
$config[$row[2]][$row[0]] = $row[1];
        else
            
$config[$row[0]] = $row[1];
    }
}
#
# Show All Mod By Westin Shafer for Beach Bums Inc.
#
if ($_GET['show'] == 'all'){
    
$config['Appearance']['products_per_page'] = 500;


Thank you....It worked this time.
__________________
Regards, Dan
X-Cart Gold Version 4.1.10

1 - One page checkout
2 - Image Generator
3 - CSDEO Pro
4 - Shop By Price
5 - Next - Previous
6 - On Sale
7 - Shop By Price

8 - Froogle & Google Base Feed
9 - Buy Together
10 - Customer Loyalty Points
11 - Customer Reward Points
Customer Reward Points Referral Add-on
12 - Product Reviews
13 - Other Custom Modifications
----------------------
http://www.townsqjewelry.com/
http://www.eroticnights4u.com/ <---- Adult Oriented - Toys
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:21 PM.

   

 
X-Cart forums © 2001-2020