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

showing subcat list when viewing a product

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-02-2009, 08:27 PM
 
loicTas loicTas is offline
 

Newbie
  
Join Date: Feb 2009
Posts: 3
 

Default showing subcat list when viewing a product

Hi

I'm using the root categories as a top menu.
I want the first level subcategories to act as a sub-menu on the left when a subcategory is viewed and also when a product is viewed.

Is this possible ?

Cheers

Loic
__________________
Version 4.2.0
Reply With Quote
  #2  
Old 02-03-2009, 11:45 AM
 
loicTas loicTas is offline
 

Newbie
  
Join Date: Feb 2009
Posts: 3
 

Default Re: showing subcat list when viewing a product

Not sure if I was clear enough so here is what I mean:
When viewing a product I'd like to have:

CATEGORY 1 CATEGORY 2 CATEGORY 3 CATEGORY 4
--------------------------------------------------------------------------------------

CATEGORY 2
---------------
subcat 2.1 PRODUCT HERE
subcat 2.2
subcat 2.3
subcat 2.4


I have used customer/main/subcategories_list.tpl but it disappears when viewing a product
__________________
Version 4.2.0
Reply With Quote
  #3  
Old 02-03-2009, 12:15 PM
 
robertswww robertswww is offline
 

X-Adept
  
Join Date: Jul 2003
Posts: 586
 

Default Re: showing subcat list when viewing a product

Hi Loic,

Yes, it is possible to do what you are asking... try the mod in this thread...

ALWAYS display first level subcats beneath root cats:
http://forum.x-cart.com/showthread.php?t=13345

Robert
__________________
X-cart 4.1.10
Reply With Quote
  #4  
Old 02-03-2009, 03:33 PM
 
loicTas loicTas is offline
 

Newbie
  
Join Date: Feb 2009
Posts: 3
 

Default Re: showing subcat list when viewing a product

Thanks Robert

Hmm... no luck so far.

Here is the code in 'subcategories_list.tpl' that I am trying to use to generate my sub-menu. It works but disappears when a subcategory is clicked and also when a product is viewed. I'd like it to stay visible to act as a sub-menu.

<ul class="subcategories">

{foreach from=$subcategories item=subcat}
<li>
<a href="home.php?cat={$subcat.categoryid}">{$subcat. category|escape}</a>
{if $config.Appearance.count_products eq "Y"}
{if $subcat.product_count}
({$subcat.product_count} {$lng.lbl_products})
{elseif $subcat.subcategory_count}
({$subcat.subcategory_count } {$lng.lbl_categories|lower})
{/if}
{/if}
</li>
{/foreach}

</ul>
__________________
Version 4.2.0
Reply With Quote
  #5  
Old 02-15-2009, 02:05 PM
 
robertswww robertswww is offline
 

X-Adept
  
Join Date: Jul 2003
Posts: 586
 

Default Re: showing subcat list when viewing a product

Quote:
Originally Posted by loicTas
Thanks Robert
Hmm... no luck so far.
Here is the code in 'subcategories_list.tpl'
Hi Loic,

To do what you want, you need to modify the categories.tpl file. Just follow the instruction at Post #10 here: http://forum.x-cart.com/showthread.php?t=13345

and for sorting the categories by position number and/or alphabetically, you may need to adjust the include/categories.php file as mentioned in Post #70 here: http://forum.x-cart.com/showthread.php?t=13345&page=7

Robert
__________________
X-cart 4.1.10
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 11:00 AM.

   

 
X-Cart forums © 2001-2020