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
  #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
  #42  
Old 10-25-2008, 07:33 PM
  davidsaldana's Avatar 
davidsaldana davidsaldana is offline
 

Senior Member
  
Join Date: Oct 2005
Posts: 187
 

Default Re: Show All Products in Catagory

Does anyone know if this works with the html catalog generation?
__________________
4.4
Code:
Hello World
Reply With Quote
  #43  
Old 10-26-2008, 07:03 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default Re: Show All Products in Catagory

Quote:
Originally Posted by davidsaldana
Does anyone know if this works with the html catalog generation?

I kind of doubt it, but you can always try it and see.
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #44  
Old 10-26-2008, 07:28 AM
  davidsaldana's Avatar 
davidsaldana davidsaldana is offline
 

Senior Member
  
Join Date: Oct 2005
Posts: 187
 

Default Re: Show All Products in Catagory

Post 35 works for 4.1.11
__________________
4.4
Code:
Hello World
Reply With Quote
  #45  
Old 11-11-2008, 07:10 AM
 
ScrapOrchard ScrapOrchard is offline
 

eXpert
  
Join Date: Mar 2008
Posts: 243
 

Default Re: Show All Products in Catagory

I tried implementing Post #35's mod... and when I click on the View All link it loads a blank page..? Help?!

http://sweetshoppedesigns.com/sweetshoppe/home.php?cat=249
__________________
www.scraporchard.com
X-Cart Pro Version 4.5.5

Altered Cart: One Page Checkout, OnSale, Buy Together, Download Expander, Smart Search, Shop by Filters
Gahela: Gahela Support System
The xCart Store: xBanners, xAccess, xMenus
Reply With Quote
  #46  
Old 12-28-2008, 01:11 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

Quote:
Originally Posted by ScrapOrchard
I tried implementing Post #35's mod... and when I click on the View All link it loads a blank page..? Help?!

http://sweetshoppedesigns.com/sweetshoppe/home.php?cat=249

I have the exact same problem with one of my subcategories. It has a lot more products than other subcategories, that might be part of the issue. Anyone knows how to solve this blank page?

Secondly: I am using Smart Search from Alteredcart and noticed the "Show All" does not function on the search result pages. Anyone got that same thing working?
__________________
____________________________
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
  #47  
Old 12-28-2008, 01:20 PM
  davidsaldana's Avatar 
davidsaldana davidsaldana is offline
 

Senior Member
  
Join Date: Oct 2005
Posts: 187
 

Default Re: Show All Products in Catagory

Quote:
Originally Posted by WhiteDoveGifts
I have the exact same problem with one of my subcategories. It has a lot more products than other subcategories, that might be part of the issue. Anyone knows how to solve this blank page?

Secondly: I am using Smart Search from Alteredcart and noticed the "Show All" does not function on the search result pages. Anyone got that same thing working?

Did you realize that post 35 also takes a note from post 1? Make sure you did the Post 1 modification, that is noted in post 35 as well, which is below:
Quote:
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;
}
__________________
4.4
Code:
Hello World
Reply With Quote
  #48  
Old 05-20-2009, 08:35 AM
 
nandita nandita is offline
 

Newbie
  
Join Date: Apr 2009
Posts: 5
 

Default Re: Show All Products in Catagory

Working on version 4.1.10. I tried out this code and once 'View all' is clicked, all the products for a particular category are displayed. How can we make this page display the page no icons and view all link just like the other pages?
__________________
Version 4.1.10
Reply With Quote
  #49  
Old 06-22-2009, 02:03 PM
 
royng royng is offline
 

Advanced Member
  
Join Date: Sep 2008
Posts: 85
 

Default Re: Show All Products in Catagory

Quote:
Originally Posted by EN4U
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


Because this is how x-cart make $$$
__________________
X-Cart DB Version: 4.1.11 GOLD
Reply With Quote
  #50  
Old 06-22-2009, 02:06 PM
 
royng royng is offline
 

Advanced Member
  
Join Date: Sep 2008
Posts: 85
 

Default Re: Show All Products in Catagory

Quote:
Originally Posted by EN4U
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


This is suck, a very simple feature!
__________________
X-Cart DB Version: 4.1.11 GOLD
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 10:47 AM.

   

 
X-Cart forums © 2001-2020