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)

glsp 09-21-2008 06:30 PM

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.

davidsaldana 10-25-2008 07:33 PM

Re: Show All Products in Catagory
 
Does anyone know if this works with the html catalog generation?

JWait 10-26-2008 07:03 AM

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.

davidsaldana 10-26-2008 07:28 AM

Re: Show All Products in Catagory
 
Post 35 works for 4.1.11

ScrapOrchard 11-11-2008 07:10 AM

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

WhiteDoveGifts 12-28-2008 01:11 PM

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?

davidsaldana 12-28-2008 01:20 PM

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


nandita 05-20-2009 08:35 AM

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?

royng 06-22-2009 02:03 PM

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

royng 06-22-2009 02:06 PM

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!


All times are GMT -8. The time now is 03:05 AM.

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