Author Topic: Remove the "back to category" link  (Read 163 times)

mrmysterious

  • Beginner
  • *
  • Posts: 25
  • A beginner
Remove the "back to category" link
« on: November 28, 2017, 00:46:17 am »
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:


Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1142
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.6
Re: Remove the "back to category" link
« Reply #1 on: November 28, 2017, 08:37:57 am »
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:
Code: [Select]
<?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.8.2
Virtuemart 3.2.6
Olympiantheme Hera (customized)

mrmysterious

  • Beginner
  • *
  • Posts: 25
  • A beginner
Re: Remove the "back to category" link
« Reply #2 on: November 28, 2017, 21:41:06 pm »
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.

 

Ghost

  • Jr. Member
  • **
  • Posts: 377
Re: Remove the "back to category" link
« Reply #3 on: November 29, 2017, 07:48:33 am »

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

  • Global Moderator
  • Full Member
  • *
  • Posts: 1142
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.6
Re: Remove the "back to category" link
« Reply #4 on: November 29, 2017, 07:50:03 am »
Hello
You probably put the comment in a HTML area not the PHP enclosed area, example
Code: [Select]
<?php
/* 
  $this_code_is_gone = TRUE) ;
*/
?>


Code: [Select]
/*
<?php
 $this_code_is_still_functional 
TRUE;
?>

*/

regards

Jörgen @ Kreativ Fotografi
Joomla 3.8.2
Virtuemart 3.2.6
Olympiantheme Hera (customized)