WooCommerce Open External Product Links In A New Tab

WooCommerce Open External Product Links In A New Tab
Stuart Avatar

Published on

< 1

min read

The functionality to open WooCommerce external product / affiliate links in a new tab is not something that is currently possible from within the core WooCommerce plugin. This functionality is useful if you’re an affiliate marketer for example that requires the external product buy now button links to open in a new tab when clicked.

After and installing the WooCommerce External Product New Tab plugin all external product links on your WooCommerce site will then automatically open in a new tab. This includes external products on product categories, single product pages and also those added via the WooCommerce short-codes etc.

The plugin does not include any settings or similar to specify only certain external products to open on a new tab and instead sets all product links to open in a new tab.

Install WooCommerce External Product New Tab

  • Download the plugin from the WordPress plugin directory.
  • Goto WordPress > Appearance > Plugins > Add New.
  • Click Upload Plugin and Choose File, then select the plugin’s .zip file. Click Install Now.
  • Click Activate to use your new plugin right away.

Install WooCommerce External Product New Tab from WordPress.org

If you would like to contribute to the plugin, provide feedback or alert me to any issues you can do so from the Github repo referenced below.

Github WooCommerce External Product New Tab





10 responses to “WooCommerce Open External Product Links In A New Tab”

  1. Lorie Avatar

    Hi Stuart – Thanks for this plugin. It does what I was hoping for except it seems to be changing my buttons.

    This is how my buttons looked – clean logo with “Learn More” popping up when rolled over:
    https://s27.postimg.org/k585wjshv/Screen_Shot_2016_12_12_at_10_56_17_AM.png

    But now they look like this after I installed your plugin:
    https://s30.postimg.org/a1vxorj8h/Screen_Shot_2016_12_12_at_10_55_28_AM.png

    Any idea how to fix this? Thank you

    1. Stuart Avatar

      Hey Lori,

      Looking at the screenshots it seems you theme that you are using is applying custom styling to the WooCommerce buttons but not inline with the standard WooCommerce button css classes.

      The plugin itself uses the standard WooCommerce css class of button, your theme developer may not have used this to style the buttons within their theme though and have potentially added their own css classes instead.

  2. Edward Avatar

    Hi. Looks good! Does it work with the latest version of WordPress (4.7)? It says it’s untested with the latest version.

    1. Stuart Avatar

      Yep it supports WordPress v4.7 and above, I will be updating the plugins read me to reflect that soon 😉

  3. Nick Avatar
    Nick

    Hi Stuart,

    First of all, thank you for this plug-in its works perfectly but i have a small problem:
    It works if i am on a single product page but not if i view a product in quickview (woocommerce products quick view), when i click on the link it opens in the same tab instead of opening a new one.
    Any suggentions/solutions?
    Thank you in advance!

    Regards,

    Nick

    1. Stuart Avatar

      Hey Nick,

      If you report the issue on github and link to the woocommerce quick view plugin you are using so I know which one I will take a look for you.

      https://github.com/stuartduff/wc-external-product-new-tab/issues

      Cheers

      1. Nick van der Mee Avatar
        Nick van der Mee

        Hi Stuart,

        I reported the issue on github.

        Regards,

      2. Nick Avatar
        Nick

        Hi Stuart,

        where you able to find out why it does not work?
        I looked at github but no information there so thats why i reply here as well.

        regards

        1. Stuart Avatar

          The reason it’s not opening in a new tab for you is due to the quick view plugin overriding the add to cart buttons with it’s own custom HTML code.

  4. Val Avatar
    Val

    Thank you – exactly what I was looking for. Just downloaded the plugin.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.