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

When Root Cat clicked display sub cat?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-16-2008, 06:10 PM
 
pepperlady pepperlady is offline
 

Advanced Member
  
Join Date: May 2008
Posts: 64
 

Default When Root Cat clicked display sub cat?

Solved by Victor D in post #5 (Works in 4.1.11 confirmed)

How would I get my categories to display sub categories when they've been clicked. For example

____________________________
All Products
Shop By Brand (clicked)
------------------------
Kick Butt
Catsup
Lizards and Gutts

Shop By Price
Shop By Category
____________________________
__________________
www.HotSauceToGo.com Like it Hot?
v4.1.12 Gold upgraded from 4.1.11 on 3/13/2009
Reply With Quote
  #2  
Old 10-17-2008, 02:56 AM
  Victor D's Avatar 
Victor D Victor D is offline
 

X-Adept
  
Join Date: Aug 2008
Posts: 643
 

Default Re: When Root Cat clicked display sub cat?

Like this?
http://forum.x-cart.com/showthread.php?t=3242&highlight=subcategories
__________________
Regards,
Victor Dubiniuk

X-Cart Skins Store
- twenty two different skins for 4.1.x and 4.2.x;
- 4.3.x compatible versions are available;
- refresh you store now!

Smart menu X-Cart add-on for 4.1.8 - 4.3.x
Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x
Reply With Quote
  #3  
Old 10-17-2008, 02:56 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: When Root Cat clicked display sub cat?

You mean in the side menu? Try one of these:

http://www.xcartmods.co.uk/navigation-x-cart-mods-c-3.html
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #4  
Old 10-17-2008, 09:37 AM
 
pepperlady pepperlady is offline
 

Advanced Member
  
Join Date: May 2008
Posts: 64
 

Default Re: When Root Cat clicked display sub cat?

Quote:
Originally Posted by Victor D

Yes that's what I want but does it work for 4.1.11? I saw the last post in that thread and someone said they can't get it to work for 4.1.7

I'll test it out but I have to figure out where to place the code. They don't seem to specify where to place the smarty code.
__________________
www.HotSauceToGo.com Like it Hot?
v4.1.12 Gold upgraded from 4.1.11 on 3/13/2009
Reply With Quote
  #5  
Old 10-20-2008, 05:07 AM
  Victor D's Avatar 
Victor D Victor D is offline
 

X-Adept
  
Join Date: Aug 2008
Posts: 643
 

Default Re: When Root Cat clicked display sub cat?

Quote:
Originally Posted by pepperlady
I'll test it out but I have to figure out where to place the code. They don't seem to specify where to place the smarty code.
Try change your skin1/customer/categories.tpl like this:
HTML Code:
{* $Id: categories.tpl,v 1.1.2.34 2008/05/26 07:35:16 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} <table cellpadding="4" cellspacing="1"> {if $current_category.parentid ne 0}{assign var="curcat" value=$current_category.parentid}{/if} {if $curcat eq 0 }{assign var="curcat" value=$current_category.categoryid}{/if} {foreach from=$categories item=c} <tr> <td valign="top"><img src="{$ImagesDir}/category_bullet.gif" width="6" height="13" alt="" /></td> <td><a href="home.php?cat={$c.categoryid}" class="VertMenuItems"><font class="CategoriesList">{$c.category}</font></a></td> </tr> {if $altcategories and $c.categoryid eq $curcat} <tr><td colspan="2"><table cellpadding="0" cellspacing="0"> {foreach from=$altcategories item=v} <tr> <td valign="top" style="padding-left:15px;"><img src="{$ImagesDir}/category_bullet.gif" width="10" height="13" alt="" /></td> <td><a href="home.php?cat={$v.categoryid}" class="VertMenuItems"><font class="CategoriesList" style="font-size:10px;">{$v.category}</font></a></td> </tr> {/foreach} </table> {/if} {/foreach} </table> {/if} {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu cellpadding=$fc_cellpadding}


and add lines
PHP Code:
if ($current_category['parentid']>0){
 
$_where "parentid='$current_category[parentid]'";
} else {
 
$_where "parentid='$current_category[categoryid]'";
}
$altcategories func_query("SELECT * FROM $sql_tbl[categories] WHERE $_where ORDER BY $sql_tbl[categories].order_by, category");
$smarty->assign("altcategories"$altcategories); 
in include/categories.php right before
PHP Code:
if (!empty($subcategories))
    
$smarty->assign("subcategories"$subcategories);

$smarty->assign("cat"$cat); 

I have tested this on 4.1.11 and found no problem
__________________
Regards,
Victor Dubiniuk

X-Cart Skins Store
- twenty two different skins for 4.1.x and 4.2.x;
- 4.3.x compatible versions are available;
- refresh you store now!

Smart menu X-Cart add-on for 4.1.8 - 4.3.x
Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x
Reply With Quote
  #6  
Old 10-21-2008, 04:55 PM
 
pepperlady pepperlady is offline
 

Advanced Member
  
Join Date: May 2008
Posts: 64
 

Default Re: When Root Cat clicked display sub cat?

Excellent! Thank you very much!
__________________
www.HotSauceToGo.com Like it Hot?
v4.1.12 Gold upgraded from 4.1.11 on 3/13/2009
Reply With Quote
  #7  
Old 10-25-2008, 02:38 PM
 
komarik komarik is offline
 

Advanced Member
  
Join Date: Jun 2003
Posts: 41
 

Default Re: When Root Cat clicked display sub cat?

Thanks for the script... but now I want to have current Category/subcategory to be highlighted or active.

Please advice.
Thanks
__________________
Webstroika.com - Web / Print / Multimedia
Lambo Doors - Direct Bolt-on Vertical Doors and Universal Vertical Door Conversion Kits - X-cart Gold 4.2.1
Reply With Quote
  #8  
Old 10-25-2008, 10:09 PM
 
pepperlady pepperlady is offline
 

Advanced Member
  
Join Date: May 2008
Posts: 64
 

Default Re: When Root Cat clicked display sub cat?

Quote:
Originally Posted by komarik
Thanks for the script... but now I want to have current Category/subcategory to be highlighted or active.

Please advice.
Thanks
That requires you to go to skin1.css and change the active:link code
It's a style sheet thing, it's simple. It'll highlight the current page you're on with whatever text decoration you want for example

a:active {
text-decoration: underline;
font-weight: bold;
}

Will look like this when active

Category 1
Category 2
-Sub
-sub2
Category 3
__________________
www.HotSauceToGo.com Like it Hot?
v4.1.12 Gold upgraded from 4.1.11 on 3/13/2009
Reply With Quote
  #9  
Old 10-25-2008, 10:28 PM
 
komarik komarik is offline
 

Advanced Member
  
Join Date: Jun 2003
Posts: 41
 

Default Re: When Root Cat clicked display sub cat?

Hey Pepperlady,

Thanks for the reply, but it doesn't work. It does work for Active state on the links, but it doesn't highlight the current category. What I need is to show current category in different color.

Cat 1
Cat 2
- Sub Cat 1
- Sub Cat 2
- Sub Cat 3 (Current)
- Sub Cat 4
Cat3

Thanks,
Nikolay
__________________
Webstroika.com - Web / Print / Multimedia
Lambo Doors - Direct Bolt-on Vertical Doors and Universal Vertical Door Conversion Kits - X-cart Gold 4.2.1
Reply With Quote
  #10  
Old 10-26-2008, 12:12 AM
 
pepperlady pepperlady is offline
 

Advanced Member
  
Join Date: May 2008
Posts: 64
 

Default Re: When Root Cat clicked display sub cat?

So you mean it needs to look literally like this

cat1
cat2
-sub1
-sub2
-sub3
cat3

and red meaning it's the active sub link?
or do you want it highlighted as in a box appears around it when active?

Should still work with a: active

You'll have to find out the exact css class for the sub cat if it doesn't work. Then apply my method to it.
__________________
www.HotSauceToGo.com Like it Hot?
v4.1.12 Gold upgraded from 4.1.11 on 3/13/2009
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 01:32 PM.

   

 
X-Cart forums © 2001-2020