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

Product relate categories, remove target="blank"

Started by EvanGR, August 23, 2018, 11:34:39 AM

Previous topic - Next topic

EvanGR

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!


jenkinhill

Look in components/com_virtuemart/sublayouts/related.php
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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

wdad

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
www.kueche1a.eu
VirtueMart 4.2.0 10905 , Joomla! 3.10.12