wordpresswoocommercee-commerce

How can I open the product in new tab?


i want my product in new tab for user. if any one click on product the product display in new tab.

it's a woocommerce website which have multiple product but i want the product should be display in new tab.


Solution

  • You can add target using jquery.

    <script>
    jQuery(document).ready(function(){
        jQuery('li.product a.woocommerce-loop-product__link').attr('target' '_blank');
    });
    </script>
    

    Above script will add "target=_blank" to all woocommerce product.