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

Custom Category and Subcategory Menu Blocks

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-04-2006, 01:22 PM
  techdesign's Avatar 
techdesign techdesign is offline
 

Advanced Member
  
Join Date: May 2003
Posts: 30
 

Default 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...
Reply With Quote
  #2  
Old 01-04-2006, 01:27 PM
 
balinor balinor is offline
 

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

Default

Please post your X-Cart version in your signature per the forum rules.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 01-04-2006, 01:30 PM
  techdesign's Avatar 
techdesign techdesign is offline
 

Advanced Member
  
Join Date: May 2003
Posts: 30
 

Default

sorry, when I started using X-Cart it wasnt necessary. But its done now
__________________
X-Cart Gold 4.4.1
X-Cart Gold 4.2.3
Reply With Quote
  #4  
Old 01-04-2006, 02:07 PM
 
balinor balinor is offline
 

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

Default

I just did this for a client...let me dig up the code and post it for you.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #5  
Old 01-04-2006, 02:49 PM
  techdesign's Avatar 
techdesign techdesign is offline
 

Advanced Member
  
Join Date: May 2003
Posts: 30
 

Default

thanks!
__________________
X-Cart Gold 4.4.1
X-Cart Gold 4.2.3
Reply With Quote
  #6  
Old 01-05-2006, 04:41 PM
  techdesign's Avatar 
techdesign techdesign is offline
 

Advanced Member
  
Join Date: May 2003
Posts: 30
 

Default

Where you able to dig it up? I really appreciate the help...
__________________
X-Cart Gold 4.4.1
X-Cart Gold 4.2.3
Reply With Quote
  #7  
Old 01-05-2006, 05:12 PM
 
balinor balinor is offline
 

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

Default

Still trying to find it....too many clients
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #8  
Old 01-06-2006, 04:48 AM
 
balinor balinor is offline
 

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

Default

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!
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #9  
Old 01-06-2006, 09:15 AM
  techdesign's Avatar 
techdesign techdesign is offline
 

Advanced Member
  
Join Date: May 2003
Posts: 30
 

Default

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}
__________________
X-Cart Gold 4.4.1
X-Cart Gold 4.2.3
Reply With Quote
  #10  
Old 01-06-2006, 09:25 AM
 
balinor balinor is offline
 

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

Default

It must be something to do with Pro Try opening a ticket with X-Cart and see if they can assist....
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
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:39 AM.

   

 
X-Cart forums © 2001-2020