Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

manufacturers products count...

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-16-2008, 06:32 AM
  Vetrivel's Avatar 
Vetrivel Vetrivel is offline
 

eXpert
  
Join Date: Apr 2008
Posts: 398
 

Question manufacturers products count...

Hi,
How to display the manufacturers products count in side menu .
like this..
-------------------
manufacturers
-------------------
manufacturer one (25)
manufacturer two(10)
.
.
...............................


Thanks in Advance.
Reply With Quote
  #2  
Old 05-19-2008, 01:05 AM
  Vetrivel's Avatar 
Vetrivel Vetrivel is offline
 

eXpert
  
Join Date: Apr 2008
Posts: 398
 

Default Re: manufacturers products count...

i got it...

thnks frnds...

your silence too helped me a lot...
Reply With Quote
  #3  
Old 05-19-2008, 01:17 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: manufacturers products count...

Quote:
Originally Posted by Vetrivel
Hi,
How to display the manufacturers products count in side menu .
like this..
-------------------
manufacturers
-------------------
manufacturer one (25)
manufacturer two(10)
.
.
...............................


Thanks in Advance.

Try to do so:

1. Back up files:
- modules/Manufacturers/customer_manufacturers.php;
- skin1/modules/Manufacturers/menu_manufacturers.tpl.

2. Edit file "modules/Manufacturers/customer_manufacturers.php",
Add the end of the file the following lines

PHP Code:
if($active_modules["Manufacturers"])
{
        
$sql "select manufacturerid, count(productid) as countpr  from ".$sql_tbl[products]." WHERE (forsale='Y') GROUP BY manufacturerid";
        
$result func_query($sql);
        
$result2=array();
        foreach (
$result as $ind => $one)
        {
            
$result2[$one[manufacturerid]]=$one[countpr];
        }
        
$smarty->assign("mstats"$result2);
        unset(
$result ,$result2);





3. Edit file "skin1/modules/Manufacturers/menu_manufacturers.tpl",
replace the contents of the file the following code

PHP Code:
{* $Idmenu_manufacturers.tpl,v 1.5 2005/11/17 06:55:47 max Exp $ *}
{if 
$manufacturers_menu ne ''}
{
capture name=menu}
{
section name=mid loop=$manufacturers_menu}
{
assign var=number value=$manufacturers_menu[mid].manufacturerid}
<
a href="manufacturers.php?manufacturerid={$manufacturers_menu[mid].manufacturerid}class="VertMenuItems">{$manufacturers_menu[mid].manufacturer} ({if $mstats[$numberne ""}{$mstats[$number]}{else}0{/if})</a>
<
br />
{/
section}
{if 
$show_other_manufacturers}
<
br />
{
assign var=number value=$manufacturers_menu[mid].manufacturerid}
<
a href="manufacturers.php" class="VertMenuItems">{$lng.lbl_other_manufacturers} ({if $mstats[$numberne ""}{$mstats[$number]}{else}0{/if})</a><br />
{/if}
{/
capture}
{include 
file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_manufacturers menu_content=$smarty.capture.menu}
<
br />
{/if} 
Reply With Quote
  #4  
Old 05-19-2008, 06:41 AM
  Vetrivel's Avatar 
Vetrivel Vetrivel is offline
 

eXpert
  
Join Date: Apr 2008
Posts: 398
 

Default Re: manufacturers products count...

thanks Yurij..
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 06:44 AM.

   

 
X-Cart forums © 2001-2020