X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   showing subcat list when viewing a product (https://forum.x-cart.com/showthread.php?t=45286)

loicTas 02-02-2009 08:27 PM

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

loicTas 02-03-2009 11:45 AM

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

robertswww 02-03-2009 12:15 PM

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

loicTas 02-03-2009 03:33 PM

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>

robertswww 02-15-2009 02:05 PM

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


All times are GMT -8. The time now is 02:50 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.