Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #2600850
External Products Open in New Tab
Closed

Comments

  • David Totaro started the conversation

    Hello,

    I bought the Pro license yesterday.

    My site has a mixture of products I sell directly and External (affiliate) Products.  Is it possible to set the 'Add to Cart' button for external products to open in a new tab?

    https://thepartycake.co.uk/shop

    Help appreciated.

    PS - Same goes for both the Compare & Wishlist Popups

  •  767
    Janilyn replied

    Hi David,

    Thank you for contacting WPClever Support Forum. 

    We’ve received your ticket and assigned one of our developers to help you with that. 

    He’ll be looking into your question and responding with specific instructions as soon as possible. 

    Please stay patient as we're having very heavy workloads, it might take some time for our developers to reach back.

    Best regards.

    Janilyn T. - WPClever Support Agent

  • David Totaro replied

    Hi Janilyn,

    Thank You for your reply.

    6 Days is an awfully long time for such a simple question.  Particularly for something so fundamental to the plugin.

    I was planning to buy the Pro Licence for both the compare and wishlist plugins as well.  Can anyone answer my question?

    Cheers

    Dave

  •  1,226
    Dustin replied

    Hi David,

    I'm so sorry for the late reply!

    Please update our plugin to the latest version 2.2.8 then add below code to current-theme (or child-theme) / functions.php

    add_filter( 'woocommerce_loop_add_to_cart_link', 'woocommerce_loop_add_to_cart_link_new_tab', 99, 2 );
    function woocommerce_loop_add_to_cart_link_new_tab( $link, $product ) {
    if ( $product->is_type( 'external' ) ) {
    return str_replace( '<a ', '<a target="_blank" ', $link );
    }
    return $link;
    }

    And the result (screen record video) https://www.dropbox.com/s/7c4wdztbz58utao/screen%20recording%202020-11-24%20at%2009.21.40.mov?dl=0

    Best regards,
    Dustin

  • David Totaro replied

    Dustin,

    Absolutely Brilliant - Exactly what I was hoping for.

    Thank You!

    Dave

  •  1,226
    Dustin replied

    You're welcome!smile.png

    If you are satisfied with our plugin and support, please reward it with a full five-star ★★★★★ rating.
    https://wordpress.org/support/plugin/woo-smart-quick-view/reviews/?filter=5
    Thank you in advance! <3

    Best regards,
    Dustin