Dear support-team,
in the product grid I would like to open the “show details” – link in a new window / tab.
Is this possible?
The other link to the product detail page by clicking at the product box itself I already changed by adding -target”_blank”- in the content-product.php.
Many thanks
Lena
Hi lenalavendel!
Try adding this to the bottom of your functions.php file.
add_action( 'wp_footer', 'enfold_customization_more_scripts' );
function enfold_customization_more_scripts() {
?>
<script type = "text/javascript">
jQuery(document).ready(function(){
jQuery('.show_details_button').attr('target', '_blank');
}
</script>
<?php
}
Cheers!
Elliott
Hi Elliott,
no, that did not work, although I cleared functions.php of all hooks / filters and disabled other plugins.
Hi!
Can you please provide a link to the product page? We would like to check it. Please try to replace the code with this:
// target _top
function add_custom_script(){
?>
<script>
(function($) {
$('.show_details_button').each(function() {
$(this).removeAttr('target');
$(this).attr('target', '_blank');
});
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'add_custom_script');
Best regards,
Ismael
Hi Ismael,
thanks, I think that worked. At least for the link.
Is it possible that this code could effect the checkout? One Costumer is having trouble with the last step of order.
Sorry for nonprofessional question…
The website: