| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Link to parent/root cat | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Link to parent/root cat
Hey guys, I know I've seen this somewhere before, but I can't find it, and can't remember how I did this. I have a couple of clients that need links directly to a products root category, and a sub-categories parent category. Any idea what the context would be for this? I tried playing with the location variable with no success. Thanks!
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Link to parent/root cat
To link to a products root category based on the location variable you can...
Open product.php FIND: Code:
BEFORE ADD: Code:
In skin1/customer/main/product.tpl use: Code:
|
|||||||||
#3
|
|||||||
|
|||||||
Re: Link to parent/root cat
Sweet - that looks like it will work exactly the way I want! Thanks Jon! Any ideas on the parent cat for a sub-cat?
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#4
|
|||||||||
|
|||||||||
Re: Link to parent/root cat
To show the parent of a subcategory:
Open home.php FIND: Code:
AFTER ADD: Code:
In your template use: Code:
|
|||||||||
#5
|
|||||||
|
|||||||
Re: Link to parent/root cat
Beautiful! Thanks a million Jon. Only tweak necessary was to change this:
<a href="home.php?cat={$current_category.parent_categ ory}"> to this: <a href="home.php?cat={$current_category.parent_categ oryid}"> Going to put this in the Custom Mods forum. FYI, this was tested on a 4.1.12 install.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#6
|
|||||||||
|
|||||||||
Re: Link to parent/root cat
Oops - thanks I've updated the instructions.
It will work on all versions 4.0-4.3. Versions prior to that didn't use the categoryid_path. |
|||||||||
#7
|
|||||||
|
|||||||
Re: Link to parent/root cat
is there anyway to see this in action? I'm not sure I follow the description of the functionality and it sounds like something one of my clients want.
I'm using X-Cart 4.3
__________________
X-Cart v4.1.6 |
|||||||
#8
|
|||||||
|
|||||||
Re: Link to parent/root cat
It is just a simple link that links the user back to the product's root category.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#9
|
|||||||
|
|||||||
Re: Link to parent/root cat
Hi Jon,
Im using 4.0.14 and the root category mod worked great thanks! However just tried the parent category part and that doesnt seem to show up - is there different coding for this version? Cheers, Chris
__________________
X-Cart version 4.6.3 |
|||||||
#10
|
|||||||
|
|||||||
Re: Link to parent/root cat
I'm trying to check for a parent category in product.tpl in version 4.4.1
Any idea how I would do that? None of the code above seems to match with the new version of x-cart. Thanks! Jenny
__________________
Version 4.3.2 |
|||||||
|
|||
X-Cart forums © 2001-2020
|