Home Forums WoodMart support forum External Buy Button Open in new tab

External Buy Button Open in new tab

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #113844

    webresultat
    Participant

    Hi,
    I would like to open “Buy now” buttons(links to external products) everywhere on all pages in a new browser tab.

    Can you help me here?

    thanks
    greetings

    #113883

    Hello,

    If you want one and the same for all the products, you can do it by means of HTML block and After Add to cart button https://xtemos.com/docs/woodmart/html-blocks-2/#before_after

    If you need individual for each product you can insert in the bottom of the short description

    Best Regards

    #114032

    webresultat
    Participant

    Thanks for your fast reply.

    It’s not about the before or after add-to-cart area,
    but it’s about the “Add-to-Cart” button itself.
    button class: button product_type_external add-to-cart-loop

    <a href="https://website.com/go/2201-10188597600" data-quantity="1" class="button product_type_external add-to-cart-loop" data-product_id="2201" data-product_sku="" aria-label="Check Availability" rel="nofollow"><span>Check Availability</span></a>

    I want these external product links to be opened in a new browser tab with “target=”_blank”

    Do you get me?

    Thanks for your help
    greetings

    #114062

    Artem Temos
    Keymaster

    In this case, you need to edit the file woocommerce/templates/single-product/add-to-cart/external.php and add the attribute.

    Kind Regards

    #114438

    webresultat
    Participant

    Thank you.
    It works.
    But I had also to add the “target=”_blank” to the woocommerce/loop/add-to-cart.php , so that the buy button is also redirecting in a new tab from shop page and category pages.

    Greetings

    #114496

    Artem Temos
    Keymaster

    OK, we are glad that you sorted it out.

Viewing 6 posts - 1 through 6 (of 6 total)