| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
rootcategory.id category.id / subcategory.id ? | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
rootcategory.id category.id / subcategory.id ?
Hello, I am trying to offer a bit of a varied menu per sub category and I'm stumped...
I've added a small code that has: <?php $a=func_htmlspecialchars($this->getComplex('category.id')); $b="996"; $c="1017"; $d="1237"; if ($a == $b || $a == $c || $a == $d ) {echo "TRUE";} else {echo "FALSE";} ?> and that one does work as if it is any of those 3 categories, it is functional - if not... it's false. However I have a lot of categories and instead of revising the script (and bogging it down with too many #'s to sort through, I was trying to find an easier way to this. So with that I was looking for the parent category id syntax (the correct wording in place of the "category.id" label) so that way I could use that in it's place. subcategory.id did not work and I'm having problems trying to find anything going backwards instead of forwards. but here is a category reference: Root = 1 Main Category = 2 Sub Category = 3 Main Category = 4 Sub Category = 5 Sub Category = 6 Sub Category = 7 Main Category = 8 etc I am looking for the syntax to add categories 2, 4 + 8 so that way it would include everything under 3, 5, 6 + 7 as well thanks for checking it out! |
|||||||
#2
|
|||||||
|
|||||||
Re: rootcategory.id category.id / subcategory.id ?
I ended up indexing all of the categories so that way coding currently looks like this
Code:
so it does work, but again we have a lot of sub categories, so if we are able to pick which main category we can highlight instead of all of that, it would definitely be less load time and bloat within the code... thanks!! |
|||||||
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|