VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: EvanGR on August 23, 2018, 11:34:39 AM

Title: Product relate categories, remove target="blank"
Post by: EvanGR 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.



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



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

Title: Re: Product relate categories, remove target="blank"
Post by: jenkinhill on August 23, 2018, 13:39:33 PM
Look in components/com_virtuemart/sublayouts/related.php
Title: Re: Product relate categories, remove target="blank"
Post by: wdad on November 20, 2019, 17:02:01 PM
Hello Evan
Did you solve the problem?

I have the same problem. www.kueche1a.eu
joomla 3.9.13, VM 3.6.8 10197 Template horme3

greetings
Helmut