| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
#1
|
|||||||||
|
|||||||||
![]() is there root cat syntax?
like {if root_cat eq 255} blah blah blah {/if} Ash
__________________
xcart 5.1.2 |
|||||||||
#2
|
|||||||||
|
|||||||||
![]() if $cat eq "1" or $current_category.parentid eq "1"
__________________
Paul Dodman e-business & m-commerce consultant w: www.luminointernet.com e: xcart@luminointernet.com Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart. |
|||||||||
|
#3
|
|||||||||
|
|||||||||
![]() but what if the are ina sub sub sub cat... you know 4 levels down?
__________________
xcart 5.1.2 |
|||||||||
#4
|
|||||||||
|
|||||||||
![]() paul,
didn't work at all. nothing showed.
__________________
xcart 5.1.2 |
|||||||||
#5
|
|||||||||
|
|||||||||
![]() $cat is the current category id
$current_category.parentid is one level up obviously (which will work if you have only one level down) There is also $current_category.categoryid_path which first element will be the first category id for the sub sub sub cat. It is in the form of 123/234/345...
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
#6
|
|||||||||
|
|||||||||
![]() how do you do a foreach from a certain category only?
like say list sub one level down just from cat 255
__________________
xcart 5.1.2 |
|||||||||
#7
|
|||||||||
|
|||||||||
![]() How about this
<ul> {foreach from=$allsubcategories item=c} {if $c.parentid eq "255"} <li>$c.category</li> {/if} {/foreach} </ul> If you don't have $allsubcategories this is how to get them (I can't remember the thread) add to /include/categories.php at the end before subcategories and cat assigns Code:
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
#8
|
|||||||||
|
|||||||||
![]() couldn't figure it out, so I hard coded it.
Here the whole scenario. There are 10 root cats all together. 5 of them have a sub cat that list gemstone cats so rings > gemstone rings > Amethyst, Pearl, Emerald, Garnet Ruby ect... earrings > gemstone earrings> Amethyst, Pearl, Emerald, Garnet Ruby ect... I want to list the sub cats of the gemstone rings on the rings root cat page and I want to list the sub cats of the gemstone earrings on the earrings root cat page
__________________
xcart 5.1.2 |
|||||||||
#9
|
|||||||||
|
|||||||||
![]() Ok try in subcategories template used to show subcats
<ul> {if $cat eq "rings"} {foreach from=$allsubcategories item=c} {if $c.parentid eq "gemstone rings"} <li>$c.category</li> {/if} {/foreach} {elseif $cat eq "earrings"} {foreach from=$allsubcategories item=c} {if $c.parentid eq "gemstone earrings"} <li>$c.category</li> {/if} {/foreach} {/if} </ul> Replace cat names with cat numbers
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
#10
|
|||||||||
|
|||||||||
![]() ok thanks, will try that.
Ash
__________________
xcart 5.1.2 |
|||||||||
|
|||
X-Cart forums © 2001-2020
|