If I view a certian product, I'd like to include a link to that products category.
So if I view a "XYZ Can Opener", there would be a link that takes me to /category/Can-Openers/
I presume I need to edit html/product.php but nothing I've tried has worked.
Any pointers?
Cheers David - looks good. Not sure where I went wrong with my code.
One thing it has shown up is the vast differences in which category different retailers give various items.
Hi,
Within html/product.php, the category of the product (if one exists) is in the following variable:
$mainProduct["category"]
Therefore, you could create a link as required with the following code (just paste this straight into html/product.php:
<?php
if ($mainProduct["category"])
{
$href = $config_baseHREF."category/".tapestry_hyphenate($mainProduct["category"])."/";
print "More products in <a href='".$href."'>".$mainProduct["category"]."</a>";
}
?>
That should do the trick!
Cheers,
David.