Share Button or Copy link Buttom on WordPress Website without plugins

go to Plugin Edit > woocommerce/templates/single-product/meta.php

 

Past this code  on last of the code 

<div class="product-copy-link">
    <input type="text" value="<?php the_permalink(); ?>" id="product-link" readonly>
    <button onclick="copyProductLink()" style="background-color: green; borderz; color: white;">Share Link</button>
</div>
<script>
    function copyProductLink() {
        var copyText = document.getElementById("product-link");
        copyText.select();
        document.execCommand("copy");
        alert("Copied : Product link");
    }
</script>

 



		
		
			

Leave a Comment

Your email address will not be published. Required fields are marked *