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)
-   -   Custom Category and Subcategory Menu Blocks (https://forum.x-cart.com/showthread.php?t=19040)

techdesign 01-04-2006 01:22 PM

Custom Category and Subcategory Menu Blocks
 
I am trying to create a custom menu block that displays depending on what the root category the user is browsing.

So far I have came up with a few ways to display the custom menu when they are in a specific category, but when they browse to a subcategory - the menu is gone.

Here are the different ways I have found so far, but again it only works for the current category that they are in:
Code:

{if $current_category.category eq "Livestock"}
{ include file="customer/menu_livestock.tpl" }
{/if}
{if $current_category.categoryid eq "2"}
{ include file="customer/menu_horse.tpl" }
{/if}
{if $cat eq "3"}
{ include file="customer/menu_pet.tpl" }
{/if}


How can I create something like this, but will work acrosss the subcategories of the specific root category?

Also there is only 3 root categories if that makes it simple...

balinor 01-04-2006 01:27 PM

Please post your X-Cart version in your signature per the forum rules.

techdesign 01-04-2006 01:30 PM

sorry, when I started using X-Cart it wasnt necessary. But its done now

balinor 01-04-2006 02:07 PM

I just did this for a client...let me dig up the code and post it for you.

techdesign 01-04-2006 02:49 PM

thanks!

techdesign 01-05-2006 04:41 PM

Where you able to dig it up? I really appreciate the help...

balinor 01-05-2006 05:12 PM

Still trying to find it....too many clients :)

balinor 01-06-2006 04:48 AM

Ok, here's the code you want:

Code:

{if $location[0].0 eq "Rootname"}
Custom menu display code
{/if}


Replace Rootname with the name of the root category you want it displayed for. If you have three root categories, all of which will show different menus, write it like this:


Code:

{if $location[0].0 eq "Rootname"}
Custom menu display code
{elseif $location[0].0 eq "Rootname2"}
Custom menu display code 2
{elseif $location[0].0 eq "Rootname3"}
Custom menu display code 3
{/if}


Hope this helps!

techdesign 01-06-2006 09:15 AM

I had tried something like this, but it doesn't seem to work. Not sure whats up. Any ideas?

Code:

{if $location[0].0 eq "Livestock"}
{ include file="customer/menu_livestock.tpl" }
{elseif $location[0].0 eq "Horse"}
{ include file="customer/menu_horse.tpl" }
{elseif $location[0].0 eq "Pet"}
{ include file="customer/menu_pet.tpl" }
{/if}


balinor 01-06-2006 09:25 AM

It must be something to do with Pro :( Try opening a ticket with X-Cart and see if they can assist....


All times are GMT -8. The time now is 01:25 PM.

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