Open products in new tab from Shop page

When someone is on my Store page, when they click on a product it opens in the same tab in the browser. I would like it to open in a new browser tab. The same as target="_blank" in HTML.

I have the current version of WordPress, Woocommerce and the X theme.

Woocommerce “support” couldn’t help…

Hi There @gpbush

Thanks for writing in! This could be possible with some custom development, which would be outside the scope of our support.

You try following this resource to see some possibilities (https://www.themelocation.com/how-to-open-externalaffiliate-product-links-to-a-new-tab-in-woocommerce/). If you find a solution which require a child theme to be setup, please check our guide here (https://theme.co/apex/forum/t/setup-how-to-setup-child-themes/57).

Thanks!

The referenced plugin is for external products only. I do not have any external products so it appears that this is of no use.

I am surprised that a basic thing like this is requires custom development .

Thank you.

Hi again,

You can achieve this by adding the following code in the Theme Options > JS:

jQuery(document).ready(function($){
	$('.woocommerce.archive .products .product').each(function(){
		$(this).find('a').attr('target', '_blank' );
	});
});

Don’t forget to clear your browser’s cache after adding the code. Let us know how this goes!

This works perfectly! Thank you for your help.

You are most welcome. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.