| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Need simpler function for cat id conditions... | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() I'll keep it simple, Im building a custom menu that consists of a main menu and a submenu. The mainmenu and submenus are called if any category id condition is met as in the example below.
<? if ($cat == 1 || $cat == 2 || $cat == 3 || $cat == 4 || $cat == 5 ) { $menu = "dothismenu"; } if ($cat == 3 || $cat == 4 ) { $submenu = "dothatmenu"; } {/if} {/if} ?> Now I have hundreds of categories and I would rather find some better logic then to write all category id's illustrated above. It is very time consuming, and the other caveat is I have to manually go into the backend and update everytime a new category is added. Is there a simpler way of performing this task, such as a smarty function or command to get the root level id, and 2nd level id based on the current catid?
__________________
Xcart 4.0.19 |
|||||||
#2
|
|||||||
|
|||||||
![]() Well I figured it out.
This does the trick! {if ($location[1].0) eq "this" } do this {/if} {if ($location[2].0) eq "that" } do that {/if}
__________________
Xcart 4.0.19 |
|||||||
#3
|
|||||||||
|
|||||||||
![]() Can you please let me know where I might be able to see your working category model, i need to do something similar
__________________
"The more you know - the less you pay" Various websites using 4.66 Pro & 5 |
|||||||||
#4
|
|||||||
|
|||||||
![]() Unfortunately, I am not at liberty to show the clients site yet until it is live. If you have any questions in the meantime feel free to ask and I will try to help you out.
__________________
Xcart 4.0.19 |
|||||||
#5
|
|||||||||
|
|||||||||
![]() i am building categories based on states and suburbs and generally need to make it about 12 digits long, but csv doesn't seem to like it. I can't understand your methodology, can you explain it any easier please.
__________________
"The more you know - the less you pay" Various websites using 4.66 Pro & 5 |
|||||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|