Remove the link that takes you back to category view on the product description

Started by andyyoung101, October 31, 2012, 02:23:07 AM

Previous topic - Next topic

andyyoung101

Hi all,

Firstly let me say I am fairly new with VM but seriously impressed so far, please be gentle with me  ;D

I have had a troll through the forums but can't find this one anywhere.

How do you remove the link on the product description page (the very last page before add to cart) which takes you back to the category you have just come from?

I have a list of categories on all pages and just want to make it look a bit cleaner.

Many thanks in advance

bytelord

Hello,

around line 75 (after Product navigation ends) you have the following code inside your file under joomla_folder/templates/your_joomla_template/html/com_virtuemart/productdetails/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') ;
}
?>

<div class="back-to-category">
    <a href="<?php echo $catURL ?>" class="product-details" title="<?php echo $categoryName ?>"><?php echo JText::sprintf('COM_VIRTUEMART_CATEGORY_BACK_TO',$categoryName?></a>
</div>


You could jst comment out the line        
<a href="<?php echo $catURL ?>" class="product-details" title="<?php echo $categoryName ?>"><?php echo JText::sprintf('COM_VIRTUEMART_CATEGORY_BACK_TO',$categoryName?></a>
or remove the three last lines or comment them or just change the following line by adding css styling:
<div class="back-to-category" style="display:none">

If your file is not located there then create a template override but copying the file  joomla_folder/components/com_virtuemart/views/productdetails/tmpl/default.php to joomla_folder/templates/your_joomla_template/html/com_virtuemart/productdetails/default.php

Some more information about template overrides: http://forum.virtuemart.net/index.php?topic=98505.0
Using the template system: http://dev.virtuemart.net/projects/virtuemart/wiki/Hints_for_the_use_of_the_template_system

2nd method is to hide that button using CSS, place it to your override css file:
.back-to-category {
display:none;
}


You could use firebug to examine your page code and css styling: http://forum.virtuemart.net/index.php?topic=102850.0

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

andyyoung101

Many Thanks Bytelord,

Very easy fix and has given me plenty of ideas for other little tweaks

;D

bytelord

Great,

Also you could take a look of the following usefull posts regarding vm product/category fields:

Product page fields: http://forum.virtuemart.net/index.php?topic=92756.0
Category page fields: http://forum.virtuemart.net/index.php?topic=97744.0
$this vs $product explained here: http://forum.virtuemart.net/index.php?topic=100696.0

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!