although i am a non-developer ,but still i tried this , but my whole website got crashed
add_action( ‘woocommerce_single_product_summary’, ‘whatsappdirect1’, 35 );
function whatsappdirect1() {
echo ‘<!DOCTYPE html>
<html>
<body>
[anchor] href=”window.location=waCurrentPage();”>[anchor-close]
<p id=”demo”></p>
<script>
waCurrentPage = function() {
return encodeURI(“whatsapp://send?phone=+91999999999&text=Check this out: ” + ‘https://’ + window.location.hostname + window.location.pathname);
}
</script>
</body>
</html>
‘;
}
-
This reply was modified 7 years, 4 months ago by moin12.