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

2nd Level Categories Menu

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-13-2013, 05:10 PM
  Wazowski's Avatar 
Wazowski Wazowski is offline
 

Advanced Member
  
Join Date: Jan 2011
Posts: 51
 

Exclamation 2nd Level Categories Menu

Hi all!

I have a flyout (not tree-like) menu on the website. How doI make it to show items starting with 2nd level categories?

For example, now it shows this:
- level 1 > level 2 > level 3
- - - - - - -> level 2
- - - - - - -> level 2 > level 3

I want it to skip the first parent category so it wouldbe:
level 2 > level 3
level 2
level 2 > level 3


Thanks!
X-cart 4.5.5
__________________
X-Cart version 4.5.5
Reply With Quote
  #2  
Old 01-02-2014, 02:11 AM
  DrQuietus's Avatar 
DrQuietus DrQuietus is offline
 

Advanced Member
  
Join Date: Dec 2005
Posts: 81
 

Default Re: 2nd Level Categories Menu

I have been trying to do this as well. With no success. Any Help?
__________________
Dave Jones
dave@industrialwebworks.net
Mostly 4.7.2 - 4.7.5
Reply With Quote
  #3  
Old 01-02-2014, 06:28 AM
  DrQuietus's Avatar 
DrQuietus DrQuietus is offline
 

Advanced Member
  
Join Date: Dec 2005
Posts: 81
 

Default Re: 2nd Level Categories Menu

I figured it out.

I have the second and all following levels showing based on the current location being a top level category, in this case "Seals" or "Hose and Fittings". Also in the code below when a person is not in a Seals or Hose and Fittings category, the menu will just show the root categories. This is using the fancy flyout menu template.

You will also need to go into webmaster mode, and get the main categories child's array number from the {$categories_menu_list} and place it where the below template has $categories_menu_list.1.childs.


Code:
{if $location[1].0 == "Seals"} {if $level == "0"} {assign var="cats" value=$categories_menu_list.1.childs} {/if} {assign var="loop_name" value="subcat`$parentid`"} <ul class="fancycat-icons-level-{$level}"> {assign var="loop_name" value="subcat`$parentid`"} {foreach from=$cats item=c key=catid name=$loop_name} <li{interline name=$loop_name} style="z-index: {$smarty.foreach.$loop_name.total|dec:$smarty.foreach.$loop_name.iteration|inc:1|inc:1001};"> {strip} <a href="home.php?cat={$catid}" class="{if $config.Flyout_Menus.icons_icons_in_categories gte $level+1}icon-link{/if}{if $config.Flyout_Menus.icons_disable_subcat_triangle eq 'Y' and $c.subcategory_count gt 0} sub-link{/if}{if $config.Flyout_Menus.icons_empty_category_vis eq 'Y' and not $c.childs and not $c.product_count} empty-link{/if}{if $config.Flyout_Menus.icons_nowrap_category ne 'Y'} nowrap-link{/if}"> {if $config.Flyout_Menus.icons_icons_in_categories gte $level+1 and $c.is_icon} <img src="{$c.thumb_url|amp}" alt="" width="{$c.thumb_x}" height="{$c.thumb_y}" /> {/if} {$c.category|amp} {if $config.Flyout_Menus.icons_display_products_cnt eq 'Y' and $c.top_product_count gt 0} ({$c.top_product_count}) {/if} </a> {/strip} {if $c.childs} {include file="`$fc_skin_path`/fancy_subcategories.tpl" cats=$c.childs parentid=$catid level=$level+1} {/if} </li> {/foreach} </ul> {elseif $location[1].0 == "Hose and Fittings"} {if $level == "0"} {assign var="cats" value=$categories_menu_list.1886.childs} {/if} <ul class="fancycat-icons-level-{$level}"> {assign var="loop_name" value="subcat`$parentid`"} {foreach from=$cats item=c key=catid name=$loop_name} <li{interline name=$loop_name} style="z-index: {$smarty.foreach.$loop_name.total|dec:$smarty.foreach.$loop_name.iteration|inc:1|inc:1001};"> {strip} <a href="home.php?cat={$catid}" class="{if $config.Flyout_Menus.icons_icons_in_categories gte $level+1}icon-link{/if}{if $config.Flyout_Menus.icons_disable_subcat_triangle eq 'Y' and $c.subcategory_count gt 0} sub-link{/if}{if $config.Flyout_Menus.icons_empty_category_vis eq 'Y' and not $c.childs and not $c.product_count} empty-link{/if}{if $config.Flyout_Menus.icons_nowrap_category ne 'Y'} nowrap-link{/if}"> {if $config.Flyout_Menus.icons_icons_in_categories gte $level+1 and $c.is_icon} <img src="{$c.thumb_url|amp}" alt="" width="{$c.thumb_x}" height="{$c.thumb_y}" /> {/if} {$c.category|amp} {if $config.Flyout_Menus.icons_display_products_cnt eq 'Y' and $c.top_product_count gt 0} ({$c.top_product_count}) {/if} </a> {/strip} {if $c.childs and $c.subcategory_count gt 0 and ($config.Flyout_Menus.icons_levels_limit eq 0 or $config.Flyout_Menus.icons_levels_limit gt $level)} {include file="`$fc_skin_path`/fancy_subcategories.tpl" cats=$c.childs parentid=$catid level=$level+1} {/if} </li> {/foreach} </ul> {else} <ul class="fancycat-icons-level-{$level}"> {assign var="loop_name" value="subcat`$parentid`"} {foreach from=$categories_menu_list item=c key=catid name=$loop_name} <li{interline name=$loop_name} style="z-index: {$smarty.foreach.$loop_name.total|dec:$smarty.foreach.$loop_name.iteration|inc:1|inc:1001};"> {strip} <a href="home.php?cat={$catid}" class="{if $config.Flyout_Menus.icons_icons_in_categories gte $level+1}icon-link{/if}{if $config.Flyout_Menus.icons_disable_subcat_triangle eq 'Y' and $c.subcategory_count gt 0} sub-link{/if}{if $config.Flyout_Menus.icons_empty_category_vis eq 'Y' and not $c.childs and not $c.product_count} empty-link{/if}{if $config.Flyout_Menus.icons_nowrap_category ne 'Y'} nowrap-link{/if}"> {if $config.Flyout_Menus.icons_icons_in_categories gte $level+1 and $c.is_icon} <img src="{$c.thumb_url|amp}" alt="" width="{$c.thumb_x}" height="{$c.thumb_y}" /> {/if} {$c.category|amp} {if $config.Flyout_Menus.icons_display_products_cnt eq 'Y' and $c.top_product_count gt 0} ({$c.top_product_count}) {/if} </a> {/strip} </li> {/foreach} </ul> {/if}
__________________
Dave Jones
dave@industrialwebworks.net
Mostly 4.7.2 - 4.7.5
Reply With Quote

The following user thanks DrQuietus for this useful post:
Wazowski (01-06-2014)
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 04:36 AM.

   

 
X-Cart forums © 2001-2020