VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Henrik Holm Nielsen on December 22, 2014, 17:29:19 PM

Title: Related products opening in new window?
Post by: Henrik Holm Nielsen on December 22, 2014, 17:29:19 PM
Hi,

Using VM 3.0.2 and J2.5.27/3.3.6

I'm fighting a problem, with Related Products always opening in a new window - at least when showing in the product-details view.
So after not being able to find the reason in my layout overrides etc., I've just tried downloading the VM Full Installer from http://virtuemart.net/downloads only to realize that this do the same thing?

As I could not find any existing product having Related Products configured, I just took "Default Product" and added 2-3 Related Products using "Custom Fields"-tab, and saved the product.

So - could anyone help me with info about which file to edit, to have the Related Products open in same window?

Cheers,
Henrik :)
Title: Re: Related products opening in new window?
Post by: GJC Web Design on December 22, 2014, 18:50:23 PM
maybe components\com_virtuemart\sublayouts\related.php

remove the ,'target'=>'_blank'  maybe

echo JHtml::link (JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $related->virtuemart_product_id . '&virtuemart_category_id=' . $related->virtuemart_category_id), $thumb   . $related->product_name, array('title' => $related->product_name,'target'=>'_blank'));
Title: Re: Related products opening in new window?
Post by: Henrik Holm Nielsen on December 22, 2014, 20:58:08 PM
Touchdown...!!!

I just changed the "_blank" in your suggestion, to "_self", and saved it as a override - works perfectly!

Thanx and I hope you have a merry christmas!

Cheers,
Henrik ;)

Quote from: GJC Web Design on December 22, 2014, 18:50:23 PM
maybe components\com_virtuemart\sublayouts\related.php

remove the ,'target'=>'_blank'  maybe

echo JHtml::link (JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $related->virtuemart_product_id . '&virtuemart_category_id=' . $related->virtuemart_category_id), $thumb   . $related->product_name, array('title' => $related->product_name,'target'=>'_blank'));