Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #500923

    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

    #501163

    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

    #501283

    Hi Elliott,
    no, that did not work, although I cleared functions.php of all hooks / filters and disabled other plugins.

    #501437

    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

    #503151

    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…

    #503154

    The website:

    #503203

    Hey!

    Can you please elaborate on the issue you are having? Code Ismael posted should only make “Show details” button to open in a new tab and should not affect any other functionality

    Cheers!
    Yigit

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.