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
  #1  
Old 08-02-2006, 04:51 PM
 
lachild lachild is offline
 

Advanced Member
  
Join Date: May 2006
Posts: 92
 

Default 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
__________________
Westin Shafer
Come Together Technologies
http://www.ComeTogetherTechnologies.com
Reply With Quote

The following user thanks lachild for this useful post:
DavyMac (06-28-2013)
  #2  
Old 08-03-2006, 02:52 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Nice one!
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 08-03-2006, 09:27 AM
 
mrkenzie mrkenzie is offline
 

Senior Member
  
Join Date: May 2006
Posts: 182
 

Default

Works great in 4.1.0.

Thanks.!
__________________
Mike Kenzie
X Cart Gold Ver. 4.1.3
X-RMA
X-AOM
X-Product Comparison
Reply With Quote
  #4  
Old 08-05-2006, 08:08 AM
 
mrkenzie mrkenzie is offline
 

Senior Member
  
Join Date: May 2006
Posts: 182
 

Default

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

Thanks
__________________
Mike Kenzie
X Cart Gold Ver. 4.1.3
X-RMA
X-AOM
X-Product Comparison
Reply With Quote
  #5  
Old 08-07-2006, 05:30 AM
 
banzai banzai is offline
 

Newbie
  
Join Date: Oct 2005
Posts: 9
 

Default

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

Thank you very much!
Reply With Quote
  #6  
Old 08-08-2006, 10:40 AM
 
gargonzo gargonzo is offline
 

Senior Member
  
Join Date: Nov 2004
Posts: 171
 

Default

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
__________________
xcart ver 4.xx/linux/php
Reply With Quote
  #7  
Old 08-09-2006, 12:45 PM
 
lachild lachild is offline
 

Advanced Member
  
Join Date: May 2006
Posts: 92
 

Default

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.
__________________
Westin Shafer
Come Together Technologies
http://www.ComeTogetherTechnologies.com
Reply With Quote
  #8  
Old 08-24-2006, 04:41 PM
 
mrkenzie mrkenzie is offline
 

Senior Member
  
Join Date: May 2006
Posts: 182
 

Default 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.
__________________
Mike Kenzie
X Cart Gold Ver. 4.1.3
X-RMA
X-AOM
X-Product Comparison
Reply With Quote
  #9  
Old 08-29-2006, 05:20 PM
 
lachild lachild is offline
 

Advanced Member
  
Join Date: May 2006
Posts: 92
 

Default 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}
__________________
Westin Shafer
Come Together Technologies
http://www.ComeTogetherTechnologies.com
Reply With Quote
  #10  
Old 10-16-2006, 10:52 AM
 
Skateboards.com Skateboards.com is offline
 

Advanced Member
  
Join Date: Jun 2006
Location: Santa Cruz, CA
Posts: 51
 

Default Re: Show All Products in Catagory

Did anybody get this mod to work for 4.0.18 on the customer side?
__________________
Skateboards.com/Surfboards.com
------------------------------------------
X-Cart Pro 4.0.18
------------------------------------------
phpMyAdmin 2.6.4
------------------------------------------
MySQL 4.1.12
------------------------------------------
CentOS release 4.4
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 03:01 PM.

   

 
X-Cart forums © 2001-2020