| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Root category display only | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Root category display only
How can I display level one or root category. The one after store name.
I am trying to add CSS class to body tag based on the root category. Currently display root and subcategories together. just like location.tpl but not looping through all root category and subs only root category I am interested in. Or give me idea how to search for the first category in categoryid_path just like str_instr in php how do I search for particular category in the category path. Thanks
__________________
4.1.10 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Root category display only
First categoty in category path:
PHP Code:
|
|||||||||
#3
|
|||||||
|
|||||||
Re: Root category display only
Thank you so much Yurij, it helped me.
__________________
4.1.10 |
|||||||
#4
|
|||||||
|
|||||||
Re: Root category display only
Hi Yurij, do you know how can I display root category id? Many thanks.
__________________
Tanya x-cart version: 4.1.7 4.1.9. 4.2 |
|||||||
#5
|
|||||||||
|
|||||||||
Re: Root category display only
Suppose it to be zero.
__________________
Regards, Victor Dubiniuk X-Cart Skins Store - twenty two different skins for 4.1.x and 4.2.x; - 4.3.x compatible versions are available; - refresh you store now! Smart menu X-Cart add-on for 4.1.8 - 4.3.x Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x |
|||||||||
#6
|
|||||||
|
|||||||
Re: Root category display only
Quote:
Thank you for your reply. The {$location[1].0} displays name of root subcategory but I need to find the way to display this subcategory id. Do you know how can I do it?
__________________
Tanya x-cart version: 4.1.7 4.1.9. 4.2 |
|||||||
#7
|
|||||||||
|
|||||||||
Re: Root category display only
The categoryid is not passed thru location array by default.
So you can: 1. modify PHP code to pass it 2. pull all the categories with their ids from db, pass them to template and find id that corresponds required category name (PHP again) 3. Parse category URL to get it's number The third way is the easiest one like this: Code:
For the root cat it will print nothing since root cat URL is home.php
__________________
Regards, Victor Dubiniuk X-Cart Skins Store - twenty two different skins for 4.1.x and 4.2.x; - 4.3.x compatible versions are available; - refresh you store now! Smart menu X-Cart add-on for 4.1.8 - 4.3.x Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x |
|||||||||
|
#8
|
|||||||
|
|||||||
Re: Root category display only
Victor, thanks a lot for your help. Works perfectly.
__________________
Tanya x-cart version: 4.1.7 4.1.9. 4.2 |
|||||||
|
|||
X-Cart forums © 2001-2020
|