X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   products count in side menu (https://forum.x-cart.com/showthread.php?t=39817)

Vetrivel 05-15-2008 10:00 PM

products count in side menu
 
hi i m newbie to xcart. i like to add products count in side menu ie in categories.
Like this
Categories1 (23)
Categories2 (32)...
how to do this..and is it possible..8O8O8O
i need some help from u people..




thnks in advance..:D

Yurij 05-16-2008 12:53 AM

Re: products count in side menu
 
Quote:

Originally Posted by Vetrivel
hi i m newbie to xcart. i like to add products count in side menu ie in categories.
Like this
Categories1 (23)
Categories2 (32)...
how to do this..and is it possible..8O8O8O
i need some help from u people..

thnks in advance..:D


1. Back up file "skin1/customer/categories.tpl"

2.Replace the contents of the file, with this code.

PHP Code:

{* $Idcategories.tpl,v 1.26 2005/11/17 06:55:37 max Exp $ *}
{
capture name=menu}
{if 
$active_modules.Fancy_Categories ne ""}
{include 
file="modules/Fancy_Categories/categories.tpl"}
{
assign var="fc_cellpadding" value="0"}
{else}
{if 
$config.General.root_categories eq "Y"}
{foreach 
from=$categories item=c}
<
font class="CategoriesList"><a href="home.php?cat={$c.categoryid}class="VertMenuItems">{$c.category} ({$c.product_count})</a></font><br />
{/foreach}
{else} {foreach 
from=$subcategories item=c key=catid}
<
font class="CategoriesList"><a href="home.php?cat={$catid}class="VertMenuItems">{$c.category}  ({$c.product_count})</a></font><br />
{/foreach}
{/if}
{/if}
{/
capture}
{ include 
file="menu.tpl" images_src="categories.gif" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu cellpadding=$fc_cellpadding


Vetrivel 05-16-2008 01:23 AM

Re: products count in side menu
 
thnks Yurij

with the help of your reply i got it.:D/

and one more thing that how to display the sub categories in the side menu bar while selecting the categories item ..
ex:
categories 1
sub-categories 1
sub-categories 2
sub-categories 3
categories 2
sub-categories 1
sub-categories 2
...........................
like this....
which file i need to touch ...


thnks in advance....8)8)8)

Yurij 05-16-2008 04:30 AM

Re: products count in side menu
 
Well, I do not know how many good solution, try to do so:

1. Edit file "include/categories.php", add the end of the file the following code:

PHP Code:

$sql "SELECT * FROM ".$sql_tbl[categories]." WHERE avail='Y' ORDER BY categoryid_path";
$result func_query($sql);
$smarty->assign("allcats"$result); 


2. Replace the contents of the file ""skin1/customer/categories.tpl"", with this code:

PHP Code:

{* $Idcategories.tpl,v 1.26 2005/11/17 06:55:37 max Exp $ *}
{
capture name=menu}
{if 
$active_modules.Fancy_Categories ne ""}
{include 
file="modules/Fancy_Categories/categories.tpl"}
{
assign var="fc_cellpadding" value="0"}
{else}
{if 
$config.General.root_categories eq "Y"}
{foreach 
from=$allcats item=c}
{if 
$c.categoryid_path|count_characters gt 3}
    {
assign var="leftpdd" value=1}
{else}
    {
assign var="leftpdd" value=0}
{/if}
{if 
$leftpdd eq 0}<br />{/if}
<
font class="CategoriesList"> {if $leftpdd ne 0}&nbsp;- 
{/if}<
a href="home.php?cat={$c.categoryid}class="VertMenuItems">{$c.category} ({$c.product_count})</a></font><br />
{/foreach}
{else} {foreach 
from=$subcategories item=c key=catid}
<
font class="CategoriesList"><a href="home.php?cat={$catid}class="VertMenuItems">{$c.category}  ({$c.product_count})</a></font><br />
{/foreach}
{/if}
{/if}
{/
capture}
{ include 
file="menu.tpl" images_src="categories.gif" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu cellpadding=$fc_cellpadding



This is useful for categories up to the second level of nesting.

In the same category are not sorted (the fields order by, and alphabetical order)

Vetrivel 05-16-2008 05:00 AM

Re: products count in side menu
 
thanks Yurij...
.


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

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