• Resolved boplinger

    (@boplinger)


    I want to add a universal link onto all product pages, that will go to an existing quote page. I can’t find any info that describes how to do it universally (onto all product pages). Just individually. There must be a way!

    Thanks.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • WooCommerce gives us points in the code where additional code can be inserted.

    For example, to go in just before the add-to-cart, you could write:

    add_action( 'woocommerce_single_product_summary', add_my_link', 25 );
    function add_my_link() {
      print '<a href="https://domain.com/quote-page/">Quote page</a>';
      return;
    }

    This is a woocommerce hook name, but some themes use their own hook names. It looks like you have a premium theme so the code is unavailable to www.remarpro.com forum members.

    At least starter level PHP skills will be needed.

    Thread Starter boplinger

    (@boplinger)

    Bless you my child!! ?? yes I can do that, wondering which php file it would be though.

    The snippet goes in functions.php for your child theme or you can try a snippets plugin.

    Thread Starter boplinger

    (@boplinger)

    Think I found the right one (in case anyone is following this thread)
    content-product.php

    Thread Starter boplinger

    (@boplinger)

    Oh whoops in functions right. Thanks so much.

    I’d advise against that. Your edits will be overwritten by the next WooCommerce update.

    • This reply was modified 3 years, 1 month ago by Majeed Raza.
    Thread Starter boplinger

    (@boplinger)

    Sorry you’re too fast, thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Add a universal link on the product pages to another internal page’ is closed to new replies.