woocommerce offtopic – Add a custom code with custom link after add to cart for every product

Question

Let’s say I need to add a custom code so visitors can visit the product’s external site. That way they can visit the product’s site.

What I want to achieve is as follows:

Add a custom code after the add to cart button;
The link to the custom code needs to be set in each product edition.
Thanks

<script type="text/javascript">
function importHotmart(){ 
    var imported = document.createElement('script'); 
    imported.src="https://static.hotmart.com/checkout/widget.min.js"; 
    document.head.appendChild(imported); 
    var link = document.createElement('link'); 
    link.rel="stylesheet"; 
    link.type="text/css"; 
    link.href="https://static.hotmart.com/css/hotmart-fb.min.css"; 
    document.head.appendChild(link);    } 
importHotmart(); 

a onclick=”return false;” href=”https://wordpress.stackexchange.com/questions/414561/*” class=”hotmart-fb hotmart__button-checkout”>Buy now

0
Dev NAAN LLC 2 weeks 2023-03-11T04:48:33-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse