News:

Looking for documentation? Take a look on our wiki

Main Menu

Remove the "back to category" link

Started by mrmysterious, November 28, 2017, 00:46:17 AM

Previous topic - Next topic

mrmysterious

Hello friends,

I would like to get rid of the link that allows the customer to get to the category view.
The idea is:

On my startpage I provide a menu that leads the customer directly to product details view and there is no need to get back to a category again (as I am selling only 1 product).
I've looked everywhere but can't find out where this link comes from.

Here the picture of product details and in yellow I have marked what has to vanish:

Joomla!-Version 3.8.5
VirtueMart 3.2.12
Template As002053free (customized)
OS Linux h
PHP 5.6.30
MySQL 5.6.19-67.0-log

Jörgen

Hello

Create a new layout for /views/productdetails/default.php
Copy this file or edit Your default.php in Your template directory. Rename the file to, for example, no-return-link.php 

templates/your-template/html/com_virtuemart/productdetails/no-return-link.php

Look for these lines:
<?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_idFALSE);
$categoryName vmText::_($this->product->category_name) ;
} else {
$catURL =  JRoute::_('index.php?option=com_virtuemart');
$categoryName vmText::_('COM_VIRTUEMART_SHOP_HOME') ;
}
?>

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


Either comment these lines out or erase them.

Then You can choose this product layout under the configuration for Your product category.


Regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

mrmysterious

Thank you so much - it worked fine when deleting the lines.

First when I commented them out the link stayed visible with the comment signs visible too: /*....*/.
Very strange.

Joomla!-Version 3.8.5
VirtueMart 3.2.12
Template As002053free (customized)
OS Linux h
PHP 5.6.30
MySQL 5.6.19-67.0-log

Ghost

Quote from: mrmysterious on November 28, 2017, 21:41:06 PM

First when I commented them out the link stayed visible with the comment signs visible too: /*....*/.
Very strange.
You must have added comments outside of PHP tags.

Jörgen

#4
Hello
You probably put the comment in a HTML area not the PHP enclosed area, example

<?php
/* 
  $this_code_is_gone = TRUE) ;
*/
?>




/*
<?php
 $this_code_is_still_functional 
TRUE;
?>

*/


regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.