0
votes

So on the product view page I wanted to create a link that says something to the extent of 'View All Sub Category Products' I know the general place where I need to make the edit in /app/design/frontend/default/{my theme}/template/catalog/product/view.phtml

However I am not sure on how to retrieve the product's sub category name and link

1
when you say product subcategory is it actually category for product but as that category has some parent category so you are saying it as subcategory do commentOscprofessionals
Yes that is correct. This is my site and an example vetmedusa.com/forceps/adson-dressing-forceps/… If you look on the top you can see Home / Forceps / Adson Dressing Forceps / Adson Dressing Forceps 4.75" German I want to include a link on the product page that says 'View All Adson Dressing Forceps' for a lot of people the navigation menu is easily missed so I wanted to add it to the product page to make it more centralized with the rest of the informationInflikted

1 Answers

0
votes

$_category = Mage::registry('current_category');

echo $_category->getURL()

This set of code will get category for you.

use getName to get name of category.

further added: $cats = $_product->getCategoryIds(); foreach ($cats as $category_id) { $_cat = Mage::getModel('catalog/category')->load($category_id) ; echo $_cat->getName(); echo $_cat->getUrl(); }