View Single Post
  #2  
Old 04-05-2011, 09:58 PM
 
Omron Khan Omron Khan is offline
 

Member
  
Join Date: Jan 2011
Posts: 14
 

Default Re: Subcategory listing in subcategory page

Anyway solved this issue. i made a new tpl file and called it in the sidebar. Here's the code in the tpl file:


Code:
{php} $t = $this->get_template_vars('cat'); $result=mysql_query("select * from xcart_categories where categoryid=$t"); while($row=mysql_fetch_array($result)) { $cid=$row['categoryid']; $pid=$row['parentid']; $cat=$row['category']; } {/php} <ul> {php} if($pid==0){ $res=mysql_query("select * from xcart_categories where parentid=$t"); while($row1=mysql_fetch_array($res)) { $cat12=$row1['category']; $cid12=$row1['categoryid']; {/php}<li><a href="home.php?cat={php}echo $cid12; {/php}">{php} echo $cat12;{/php}</a></li>{php} } }else { $res=mysql_query("select * from xcart_categories where parentid=$pid"); while($row1=mysql_fetch_array($res)) { $cat12=$row1['category']; $cid12=$row1['categoryid']; {/php}<li><a href="home.php?cat={php}echo $cid12; {/php}">{php} echo $cat12;{/php}</a></li>{php} } } {/php} </ul>


if you wanna see a live demo of it check here
http://www.taqshop.com/xcart/home.php?cat=361
__________________
x-cart-4.4.1-pro
Reply With Quote