Author Topic: Product relate categories, remove target="blank"  (Read 207 times)

EvanGR

  • Jr. Member
  • **
  • Posts: 144
Product relate categories, remove target="blank"
« on: August 23, 2018, 11:34:39 am »
Hello,

In product page, the related categories open in a new browser tab because of target="_blank".
I would like to change that. Also, I don't want the category images which are loaded in the HTML.

I am pasting the relevant relatedcategories template code I am looking to tweak.

Code: [Select]

 <div class="product-related-categories">
   
 <?php foreach ($this->product->customfieldsSorted['related_categories'] as $field) { 
        if (
$field->display) { ?>

<div class="product-field product-field-type-<?php echo $field->field_type ?>">
    <span class="product-field-display"><?php echo $field->display ?></span>
</div>

...


The resulting HTML is like so:

Code: [Select]

<div class="product-field product-field-type-Z">
    <span class="product-field-display"><a href="/category" title="category" target="_blank"><img src="/images/stories/virtuemart/category/resized/mycategory.jpg" alt="My Category"  /> Category Name</a></span>
</div>


...

Thanks!


jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27027
  • Always on vacation
    • Jenkin Hill Internet
Re: Product relate categories, remove target="blank"
« Reply #1 on: August 23, 2018, 13:39:33 pm »
Look in components/com_virtuemart/sublayouts/related.php
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.4.0.9935 on Joomla 3.8.12 PHP 7.0.31
Testing VM 3.4.0.9941 on Joomla 3.8.12