Author Topic: Change 'back to category' button in product details view  (Read 3699 times)


  • Beginner
  • *
  • Posts: 7
Change 'back to category' button in product details view
« on: October 29, 2012, 18:56:12 PM »

When I view a product's details on the FE, there's a button that says 'back to: (category)'. My products are ordered mainly by Manufacturer, so I want to change that link to take a person back to the products by that Manufacturer, instead of the Category that the product is part of.

I know which code needs editing:
<?php // Back To Category Button
   if ($this->product->virtuemart_category_id) {
      $catURL =  JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id='.$this->product->virtuemart_category_id);
      $categoryName = $this->product->category_name ;
   } else {
      $catURL =  JRoute::_('index.php?option=com_virtuemart');
      $categoryName = jText::_('COM_VIRTUEMART_SHOP_HOME') ;
I've tried a few ways of changing the links, but it doesn't work quite right. I want it to go back to the manufacturer page I came from. Not the Manufacturer page that shows the details of the Manufacturer and then you need to click on a button to view it's products, but directly to the page where you view only the products of that manufacturer.

For now I just entered a Javascript link to take you back to the page you came from, but I want the proper link to take you to the manufacturer items.

J2.5.7  VM2.0.12f 

Testing Site: (although it uses the Javascript back link at the moment)


  • Beginner
  • *
  • Posts: 16
Re: Change 'back to category' button in product details view
« Reply #1 on: October 31, 2012, 10:13:43 AM »
haha...I have same question ^^! I dont know how to back category, because I use slideshow module to show product, and this module cant back category before. I want it back to homepage.

my website: