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

Subcategory drop-down per Category Page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-06-2009, 09:41 PM
 
vikeny vikeny is offline
 

Member
  
Join Date: Jun 2004
Location: Los Angeles, CA.
Posts: 22
 

Default Subcategory drop-down per Category Page

Hello,

I've been scouring these pages for the last hour. A variant of this question has been asked and answered in various degrees but a answer to this one simple mod has been surprisingly hard to find.

It's simple really: For any category page, display a drop-down menu/selector that is populated with the 1st level sub-categories of the parent category page.

I'd appreciate any help - a push in the right direction, perhaps a link to a third-party product.

The site I need this mod for runs X-Cart v. 4.1.8

Many thanks,
vik
__________________
--
1: X-Cart 4.0.x(live), Apache/2.0.52 (Red Hat), PHP 4.3.9, MySQL 4.1.20
2,3,4,5: X-Cart 4.0.x(live), Apache/2.0.54 (Linux), PHP 4.4.0, MySQL 4.0.25
Reply With Quote
  #2  
Old 04-09-2009, 01:36 PM
 
mudebate mudebate is offline
 

Advanced Member
  
Join Date: Jan 2009
Posts: 62
 

Default Re: Subcategory drop-down per Category Page

There was a thread where someone else shared how to do this. It looked something like this:

Quote:
{capture name=menu}
{if $active_modules.Fancy_Categories}
{include file="modules/Fancy_Categories/categories.tpl"}
{assign var="additional_class" value="menu-fancy-categories-list"}
{else}
{assign var=thiscat value=$cat}
{assign var=par value=0}
{foreach from=$categories item=cats}
{assign var=Mcatid value=$cats.categoryid}
{foreach from=$allsubcategories.$Mcatid item=subb}
{if $subb.categoryid eq $thiscat}
{assign var=par value=$subb.parentid}
{/if}
{/foreach}
{/foreach}
<ul>
{foreach from=$categories_menu_list item=c}
<li><a href="home.php?cat={$c.categoryid}" title="{$c.category|escape}">{$c.category}</a></li>
{if $c.categoryid eq $par}
{foreach from=$allsubcategories.$par item=sub}
{if $sub.parentid eq $c.categoryid}
<a href="home.php?cat={$sub.categoryid}" class="subMenuItem">{$sub.category}</a>
{/if}
{/foreach}
{/if}
{foreach from=$allcategories item=cat}
{if $cat.parentid eq $c.categoryid}
<a href="home.php?cat={$cat.categoryid}" class="subMenuItem">{$cat.category}</a>
{/if}
{/foreach}
{/foreach}
</ul>
{assign var="additional_class" value="menu-categories-list"}
{/if}
{/capture}
{include file="customer/menu_.tpl" title=$lng.lbl_categories content=$smarty.capture.menu}


__________________
mudebate


X-cart 4.11 - One page checkout, category meta tags, manufacturer meta tags, a few others


X-cart 4.2, tabbed products menu



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:27 AM.

   

 
X-Cart forums © 2001-2020