Open Marketplace "Buy Now" links in a new window

Currently, Buy Now (external products/affiliate links) open in the same window. That's not optimal, as people might want to but two products. Having them leave the site makes it more difficult.

I can't find an option to open those links in a new window (target _blank).

I'd hate to add a plug-in to resolve this, as this should be simple, and I'd think it's an obvious function that should have been included.

Did I just miss something somewhere?

Thanks in advance!

  • aecnu
    • WP Unicorn

    Greetings fusionx22,

    Thank you for the great question!

    Which theme are you using for your Market Press installation?

    Frame Market/Grid Market by any chance?

    Perhaps there will need to be a change in the hard coding of either Market Press or the theme depending on how you are rendering the Market Press pages.

    Please advise.

    Cheers, Joe

  • Jeffrey Beer
    • Design Lord, Child of Thor

    I'm using a third-party premium theme.

    Rendering? It's just using the default page generation - no custom templates, etc.

    I looked all over the configuration options and can't find anything about it.

    Maybe you could add an option "open in a new window" in the Product editor, or make it a default in Settings.

    For now, I'm going to edit the core files to add target="_blank". It's easy to replace when an update overwrites it.

    But I think this is very important and should be resolved.

  • Jeffrey Beer
    • Design Lord, Child of Thor

    Oh - if anyone else wants to do this, just open template-functions.php, go to line 3135, and add target="_blank". I put it before the href - it's easier to read and edit. Be careful you don't change any of the single or double quotes in the existing code.

    $button = '<a class="mp_link_buynow" target="_blank" href="' . esc_url($product_link) . '">' . __('Buy Now »', 'mp') . '</a>';

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.