X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Show All Products in Catagory (https://forum.x-cart.com/showthread.php?t=23796)

lachild 08-02-2006 04:51 PM

Show All Products in Catagory
 
I know there have been a couple of mods that do this but most of them require alot of hacking the system.

Heres a quick mod to give you a "Show All" link next to your page results.

Quick and painless like.

(Please note this mod is for 4.1.2! i do not know if this will work on older versions as I have never used them)


Instructions:

Locate this section in the init.php around line #329:
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:

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


Next open up /customer/main/navigation.tpl around line 4 locate:

Code:

{if $total_pages gt 2}
<table cellpadding="0">
<tr>
        <td class="NavigationTitle">{$lng.lbl_result_pages}:</td>


Add this right after the /td:
Code:

{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}


Hope this helps

balinor 08-03-2006 02:52 AM

Nice one!

mrkenzie 08-03-2006 09:27 AM

Works great in 4.1.0.

Thanks.!

mrkenzie 08-05-2006 08:08 AM

Did you get this to work in the admin side? It works in the customer side, but not in the admin side.

Thanks

banzai 08-07-2006 05:30 AM

Works great in 4.0.17 if you order config.php instead of init.php

Thank you very much!

gargonzo 08-08-2006 10:40 AM

hi folks. version 4.07. I cannnot find init.php.. i looked in config.php.. but the snippet of code is not the same as in init.php

can someone advise on how to make this work???
tia

garz
4.07 php linux

lachild 08-09-2006 12:45 PM

To get this to work in the admin screen... Change the following line from the mod:

Code:

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


To this:

Code:


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


As for getting this to work in 4.0.7... I've never used it.. But all you should need to do is locate the section of code that pulls in the config info from the database... Right after it, change the varriable that sets the displayed products to some un-reachable number...

I set it to 500 as I can't see how any more then that would even load on the page. But you're welcome to set this number to any number you wish.

mrkenzie 08-24-2006 04:41 PM

Re: Show All Products in Catagory
 
One more question -

Know how to either not show the "Show All" link on the manufacturers page or have it work on the manufacturers page?

Thanks.

lachild 08-29-2006 05:20 PM

Re: Show All Products in Catagory
 
Thanks for pointing this out...

Heres the updated init.php to fix the admin orders screen and the manufaturers page.

Code:

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


To turn this off for both the orders screens and the Manufactureres screens go back to the section in /customer/main/navigation.tpl and change this:

Code:

<td>Show All |</td>

To this:

Code:

{if $smarty.server.PHP_SELF ne '/manufacturers.php'}
{if $smarty.server.PHP_SELF ne '/admin/orders.php'}
{if $smarty.server.PHP_SELF ne '/orders.php'}
<td><a href="{$navigation_script}&amp;show=all">View All</a> |</td>
{/if}
{/if}
{/if}


Skateboards.com 10-16-2006 10:52 AM

Re: Show All Products in Catagory
 
Did anybody get this mod to work for 4.0.18 on the customer side?

showoff 11-03-2006 01:37 AM

Re: Show All Products in Catagory
 
This worked immidiatly for me on 4.1.3,
excellent mod, small and effective.

Jerrad 11-04-2006 02:57 AM

Re: Show All Products in Catagory
 
Anybody managed to get this working in 4.0.12?

It seems to work in 4.0.17, according to banzai, but adding the code
to config.php in my version, resulted in nothing...

Thanks! :D

gastu 11-05-2006 05:57 PM

Re: Show All Products in Catagory
 
nice!!

HEK 11-12-2006 09:17 PM

Re: Show All Products in Catagory
 
Quote:

Originally Posted by lachild
Code:

{if $total_pages gt 2}
<table cellpadding="0">
<tr>
        <td class="NavigationTitle">{$lng.lbl_result_pages}:</td>




I am using 4.1.3 but I cannot find this code in
customer/man/navigation.tpl

my code starts like that

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>
{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><td>Show All |</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>
<p />
{/if}


could anyone help me?

lachild 11-13-2006 06:51 AM

Re: Show All Products in Catagory
 
EDIT: Looking into this further... I see that you have the code in there correctly it's just that when the forums moved to the new BBS software it currupted the link. I have fixed the original post.

For your problem locate line 11 that reads:
Code:

{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><td>Show All |</td>
{/if}


Change it so it reads:

Code:

{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>
{** 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}





Hope this helps

HEK 11-14-2006 03:51 PM

Re: Show All Products in Catagory
 
lachild

Thank you very much!!!!
It works perfectly

firelight 01-30-2007 06:22 PM

Re: Show All Products in Catagory
 
Hi,

This is what I did to make it work for my 4.0.19 version.
I will do more testing but it I'm just too tired right now.:wink:

With my non-programmer experience, I just placed the code to make the link "show all" show up in a different spot.

1) I modified my config.php as specified above.

2) This is my complete navigation.tpl file:

Code:

{* $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">
<TD nowrap>{$lng.lbl_result_pages}:&nbsp;&nbsp;</TD>
{if $current_super_page gt 1}
<TD><A href="{$navigation_script}&page={math equation="page-1" page=$start_page}"><IMG src="{$ImagesDir}/larrow_2.gif" width="9" height="9" border="0" alt="{$lng.lbl_prev_group_pages}"></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}&page={math equation="page-1" page=$navigation_page}"><IMG src="{$ImagesDir}/larrow.gif" width="9" height="9" border="0" alt="{$lng.lbl_prev_page}"></A>&nbsp;</TD>
{/if}
{/if}
{if %page.index% eq $navigation_page}
<TD align="center" title="{$lng.lbl_current_page}: #{%page.index%}">
<B>{%page.index%}</B>
</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 width="{$cell_width}" background="{$ImagesDir}/page{$suffix}.gif" align="center" valign="bottom"><A href="{$navigation_script}&page={%page.index%}" style="text-decoration: none" title="{$lng.lbl_page} #{%page.index%}">{%page.index%}</A><IMG src="{$ImagesDir}/spacer.gif" width="{$cell_width}" height="1" border="0"></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}&page={math equation="page+1" page=$navigation_page}"><IMG src="{$ImagesDir}/rarrow.gif" width="9" height="9" border="0" alt="{$lng.lbl_next_page}"></A></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}
{/if}
{/section}
{if $current_super_page lt $total_super_pages}
<TD><A href="{$navigation_script}&page={math equation="page+1" page=$total_pages_minus}"><IMG src="{$ImagesDir}/rarrow_2.gif" width="9" height="9" border="0" alt="{$lng.lbl_next_group_pages}"></A></TD>
{/if}
</TR></TABLE>
<P>
{/if}


I hope this helps.

Reed 03-15-2007 01:57 PM

Re: Show All Products in Catagory
 
Thanks Westin-

It works for me in 4.1.5 after changing the code you referenced in post #15. This mod is simple clean and functional. I thought getting something like this working on the customer front end would have been much more difficult. Thanks for sharing your code!

Wambli 04-09-2007 07:19 PM

Re: Show All Products in Catagory
 
Does anyone have this working in 4.1.6 or anything like it I can't get it to work?

Scott DeToffol 04-10-2007 07:33 AM

Re: Show All Products in Catagory
 
Can someone point me to an example of this on a working site?

lachild 05-15-2007 03:47 PM

Re: Show All Products in Catagory
 
Quote:

Originally Posted by Scott DeToffol
Can someone point me to an example of this on a working site?


Sure this is working on http://www.beachbums.com

Also this should work with 4.1.6. We are currently using this on 4.1.4 and I cant imagine that the code base would have been completely altered.

funkymonkey 05-27-2007 02:45 PM

Re: Show All Products in Catagory
 
Looks like a great mod but it didn't work for me (4.0.13). The following error is generated:

Fatal error: Smarty error: [in customer/main/navigation.tpl line 6]: syntax error: unidentified token '.php'' (Smarty_Compiler.class.php, line 1372) in home/toroleat/public_html/Smarty-2.6.3/Smarty.class.php on line 1082

I don't have init.php but made the first code change in config.php as it all reads the same.

Any suggestions?

hoosierglass 06-01-2007 03:26 PM

Re: Show All Products in Catagory
 
Trying to get this to work in 4.1.7 and have yet to get anything to fly. If anyone knows this mod and would like to point me in the right direction feel free to do so.
Here is my naviagtion.tpl
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>
{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>
{** 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}
{/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}


And my init.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;
}
#
db_free_result($c_result);

$config["Sessions"]["session_length"] = $use_session_length;

#
# Include data cache functionality
#
include_once($xcart_dir."/include/data_cache.php");


Not real sure why it won't work as this is exactly as posted.

jeanne 07-08-2007 02:53 PM

Re: Show All Products in Catagory
 
When used with XCSEO (4.1.8 store) it does not work. The link that is created when you click on View All does not have the right information.

Just an FYI. I might try and figure it out, but it's probably beyond me.

Jeanne
------------
4.0.18 live
4.1.8 in development

hrothbeorht 07-13-2007 12:49 PM

Re: Show All Products in Catagory
 
I'm also very interested in getting this mod to run in 4.1.7
Perhaps I've missed something. If anyone has it working in 4.1.7 please post!
-hroth

gb2world 10-11-2007 05:25 PM

Re: Show All Products in Catagory
 
The code from post #9 works fine in 4.1.8 - thanks!

boxerbay 05-21-2008 02:59 PM

Re: Show All Products in Catagory
 
does not work for my 4.1.7 site? :(

balinor 05-21-2008 03:26 PM

Re: Show All Products in Catagory
 
It is odd...on some servers I can't get this to work...on most it is fine. Haven't been able to figure out what the common denominator is.

WhiteDoveGifts 05-29-2008 02:32 AM

Re: Show All Products in Catagory
 
Has anyone tested this mod in 4.1.10 yet?

EN4U 05-31-2008 08:07 PM

Re: Show All Products in Catagory
 
Quote:

Originally Posted by WhiteDoveGifts
Has anyone tested this mod in 4.1.10 yet?


^^^ Nice mod..... If anyone can figure this out for the newest version that would be great.

funkymonkey 05-31-2008 08:58 PM

Re: Show All Products in Catagory
 
1 Attachment(s)
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}

EN4U 06-02-2008 08:38 AM

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

yuichi 06-02-2008 12:59 PM

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??

effour 06-13-2008 08:50 AM

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>

pcparts 06-15-2008 12:00 AM

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

yuichi 06-15-2008 06:08 AM

Re: Show All Products in Catagory
 
Thanks pcparts!
I tried your code and it all worked! Thanks again!

WhiteDoveGifts 07-01-2008 01:31 PM

Re: Show All Products in Catagory
 
Great mod, thanks for coding! Works fine with me on 4.1.10 and was easy to install :D8)

EN4U 07-01-2008 01:56 PM

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...

pcparts 07-01-2008 11:39 PM

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;



EN4U 07-02-2008 12:51 AM

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.


All times are GMT -8. The time now is 06:37 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.