Hi peeps,
In your products template file (
SITE_ROOT/components/com_virtuemart/views/productdetails/tmpl/default.php) <- should really be in your template overrides, but it's here so you know which file to look for.
Add this piece of code somewhere up the top.
$categoryModel = VmModel::getModel ('category');
$categoryArray = array();
foreach ($this->product->categories as $catid) :
$categoryArray[] = $categoryModel->getCategory ($catid, true);
endforeach;
echo '<pre>'; print_r($categoryArray); echo '</pre>';
Now you have all the category information stored in the
$categoryArray variable. Unfortunately the function is a bit heavy, but it's the only way I can see it working without using core hacks.
Obviously I should tell you how to use the variable... I'm sure others would want to know too.
So where you want to output your category list, use this nifty piece of code:
foreach ($categoryArray as $category) :
echo '<p>'. $category->category_name .'</p>'; // <- STYLE HOWEVER YOU WANT
endforeach;
Done.
I hope this helps.
