Author Topic: Output sub categories for a product  (Read 551 times)

Resonanz

  • Beginner
  • *
  • Posts: 15
Output sub categories for a product
« on: May 19, 2011, 02:08:02 am »
Hi,

I have a music store with 2 main categories for each product: Author and Genre

Under each of these is a variety of sub categories.

What I would like to do is have these displayed in the browse page for each product:

Author: xxxxxx (Linked to subcategory browse page)
Genre: xxxxxx (Linked to subcategory browse page)

Presently I got this code below from another topic which works great to display only the category relevant to the category flypage the product is being viewed on, which I have been trying to use as a platform to implement the above but to no avail:

<?php $ps_product_categories = new ps_product_category;
$mycatname = $ps_product_categories->get_field($category_id,'category_name'); ?>
<?php
if($category_id) { ?>

<a title="Author Name" href="<?php $sess->purl(URL."index.php?option=com_virtuemart&amp;page=shop.browse&amp;category_id=".$category_id) ?>">
<?php echo $mycatname; ?></a>
<?php } else {echo $mycatname;} ?>