related products in new window

Support desk for Multipurpose Quark Theme
GK User
Thu Aug 27, 2015 6:15 pm
hello , I have a problem with related products and related categories , if I click on the product I open in a new window , because it does not open the same page ? thank you
User avatar
Junior Boarder

GK User
Fri Aug 28, 2015 8:04 am
Could you please post an url to your site?
User avatar
Moderator

GK User
Fri Aug 28, 2015 1:15 pm
send pm
User avatar
Junior Boarder

GK User
Wed Sep 02, 2015 2:44 pm
Could you please describe what I need to do and where to click to see this issue (screenshots might be handy)
User avatar
Moderator

GK User
Mon Sep 07, 2015 7:08 pm
I can't reproduce the issue on my test machine... Could you please describe how (beside adding related products to a single product) have you enabled related products section?
User avatar
Moderator

GK User
Mon Sep 07, 2015 7:13 pm
One more thing that you could verify - please change template back to Beeze or Protostar and let me know if related products still opens in new tab/window.
User avatar
Moderator

GK User
Tue Sep 08, 2015 9:21 am
Cyberek wrote:I can't reproduce the issue on my test machine... Could you please describe how (beside adding related products to a single product) have you enabled related products section?


Yes
User avatar
Junior Boarder

GK User
Tue Sep 08, 2015 9:32 am
Cyberek wrote:One more thing that you could verify - please change template back to Beeze or Protostar and let me know if related products still opens in new tab/window.


I changed the template, is the same problem
User avatar
Junior Boarder

GK User
Tue Sep 08, 2015 10:34 am
SOLVED:
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'));
User avatar
Junior Boarder

GK User
Thu Sep 10, 2015 12:25 pm
I was going to write about that - it seems like it is core VM issue, perhaps you could write on their's support forum with info about this - perhaps they could add a configuration parameter that would decide if an element should open in same or new window.
User avatar
Moderator

GK User
Sat Oct 17, 2015 4:26 pm
I had a similar problem with Storefront template v.3.18.1 and VirtueMart 3.0.10. I resolved by editing "/components/com_virtuemart/sublayouts/related.php". Look for 'target'=>'_blank' and change to 'target'=>'_self'.
ORIGINAL CODE:
Code: Select all
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'));

CHANGED AS FOLLOWS:
Code: Select all
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'=>'_self'));

This worked for me but not sure if there is a better way to do this e.g. in overrides?
User avatar
Fresh Boarder

GK User
Mon Oct 19, 2015 4:00 pm
use this: array('title' => $related->product_name,'target'=>' '));


sysman wrote:I had a similar problem with Storefront template v.3.18.1 and VirtueMart 3.0.10. I resolved by editing "/components/com_virtuemart/sublayouts/related.php". Look for 'target'=>'_blank' and change to 'target'=>'_self'.
ORIGINAL CODE:
Code: Select all
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'));

CHANGED AS FOLLOWS:
Code: Select all
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'=>'_self'));

This worked for me but not sure if there is a better way to do this e.g. in overrides?
User avatar
Junior Boarder

GK User
Wed Oct 21, 2015 11:04 am
Thanks for sharing the solution.
If you have any additional questions regarding this topic, please let me know.
User avatar
Moderator


cron