Overwrite on click function for woocommerce products to external link
Budget: €30 – €250 EUR
Hi,
We are an affiliate site, but also have products we sell. Now we need to overwrite the standard 'on click' function that goes to the product itself, on some products, to go directly to an affiliate link.
If you see the attached file (designed in the blue area), you see an edit page of a woocommerce product.
At the tab general we want:
1. Toggle with 'affiliate product' yes/no
2. An edit field for a link to the affiliate product.
Code: WHEN the toggle is set to yes AND the link field is entered, on click of a product, THEN go to the affiliate link, instead of the product page.
Example page with products:
https://betalenintermijnen.com/categorie/hoekbank-gespreid-betalen-in-termijnen/
Can someone help us? Thanks!
We are an affiliate site, but also have products we sell. Now we need to overwrite the standard 'on click' function that goes to the product itself, on some products, to go directly to an affiliate link.
If you see the attached file (designed in the blue area), you see an edit page of a woocommerce product.
At the tab general we want:
1. Toggle with 'affiliate product' yes/no
2. An edit field for a link to the affiliate product.
Code: WHEN the toggle is set to yes AND the link field is entered, on click of a product, THEN go to the affiliate link, instead of the product page.
Example page with products:
https://betalenintermijnen.com/categorie/hoekbank-gespreid-betalen-in-termijnen/
Can someone help us? Thanks!