News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Back to category button

Started by bestcons, October 30, 2012, 20:36:25 PM

Previous topic - Next topic

bestcons

The release of 2.0.8 would include some template enhancements, like a "back to category button".
Can someone explain where this button is located without having to change the code.
Thanks,
bestcons

bytelord

Hello,

Latest version of VM is 2.0.12f which i am suggesting to implement.
The back to category button to be appeared you have to edit your custom template for virtuemart.

Edit your file under joomla_folder/templates/your_joomla_template/html/com_virtuemart/productdetails/default.php
around line 75 (after Product navigation ends) the following code:

<?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>


That's the only way have the back to category button to work.

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

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!