News:

Looking for documentation? Take a look on our wiki

Main Menu

Change 'back to category' button in product details view

Started by chosenanointed, October 29, 2012, 18:56:12 PM

Previous topic - Next topic

chosenanointed

Hi,

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:
/components/com_virtuemart/views/productdetails/tmpl/default.php
<?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) http://gabinasa.co.za/new-site/index.php/test/derma-under-eye-gel-patches-detail

ngodoan

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: http://nguyenthuyartera.com/shopping/vi/component/virtuemart/cham-soc-toc/sp-smoothen-shampoo-250ml-detail.html?Itemid=0