Home Forums Basel support forum Add "onclick" to “add to chart” button on single product page

Add "onclick" to “add to chart” button on single product page

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #9893

    mobiflora
    Participant

    Hi xtemos,

    can you please help me with this:

    I’m running basel/woo commerce with affiliate products. The “add to chart” button on single product page therefore has been changed to fire the affiliate link.

    To track click conversions with google adwords, the “add to chart” button link now has to be modified using Google Adwords tracking code like:

    <a onclick=”goog_report_conversion (‘http://ihrebeispielurl.de/ihr-link’)”
    href=”http://ihrebeispielurl.de/ihr-link”>Bestellen…

    How can I do this?

    Thanks very much!

    Till

    #9894

    Artem Temos
    Keymaster

    Hello,

    But you have already asked similar questions and we provided you with a code to change this button here https://xtemos.com/forums/topic/replace-add-to-cart-category-loop/#post-9892

    Regards

    #9899

    mobiflora
    Participant

    Hi Xtemos,

    firsthand I’d like to say thanks for your awesome fast support 😉
    Your code helped me on the category loop page buttons.

    Sorry for not being clear:

    Now I need to change the link of the “add to cart” button on single product page by adding the onclick-tag. Is there a template to apply this change to?

    Thanks
    Till

    #9900

    Artem Temos
    Keymaster

    Hi,

    It is a more WooCommerce related question. Check out the file woocommerce/templates/single-product/add-to-cart/external.php

    Regards

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