Add "onclick" to “add to chart” button on single product page
-
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
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
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
Hi,
It is a more WooCommerce related question. Check out the file woocommerce/templates/single-product/add-to-cart/external.php
Regards