Lestor Posted May 27, 2021 Share Posted May 27, 2021 Hi there, I've written a script for a custom button to be added under my product page. However, I want the whatsapp url to be open in a new window upon clicking on the button. Below is the script I've written: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script> $(function() { $("<a class='whatsappbtn' href='https://api.whatsapp.com/send?phone=6588747658'> Whatsapp Us! </a>").insertAfter(".sqs-add-to-cart-button-wrapper"); }); </script> Hope to get some help, thank you! Link to comment
tuanphan Posted May 28, 2021 Share Posted May 28, 2021 Hi. Use new code <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script> $(function() { $('<a class="whatsappbtn" href="https://api.whatsapp.com/send?phone=6588747658" target="_blank"> Whatsapp Us! </a>').insertAfter(".sqs-add-to-cart-button-wrapper"); }); </script> Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
Lestor Posted May 28, 2021 Author Share Posted May 28, 2021 Thanks a bunch! I'm also looking to add a custom facebook icon on my product page. I'm currently having problem with adding the facebook image. Below is my code: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script> $(function() { $("<a class='facebookbtn' href='https://facebook.com' img src='http://simpleicon.com/wp-content/uploads/facebook.png'>Facebook</a>").insertAfter(".sqs-add-to-cart-button-wrapper"); }); </script> Mind helping with this as well? haha Link to comment
tuanphan Posted May 28, 2021 Share Posted May 28, 2021 4 hours ago, Lestor said: Thanks a bunch! I'm also looking to add a custom facebook icon on my product page. I'm currently having problem with adding the facebook image. Below is my code: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script> $(function() { $("<a class='facebookbtn' href='https://facebook.com' img src='http://simpleicon.com/wp-content/uploads/facebook.png'>Facebook</a>").insertAfter(".sqs-add-to-cart-button-wrapper"); }); </script> Mind helping with this as well? haha You mean add both fb + whatsapp on same position? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
Lestor Posted May 29, 2021 Author Share Posted May 29, 2021 Yup two buttons side by side. But for the fb, I want to use the facebook image icon instead of just a button Link to comment
tuanphan Posted June 1, 2021 Share Posted June 1, 2021 On 5/29/2021 at 10:40 AM, Lestor said: Yup two buttons side by side. But for the fb, I want to use the facebook image icon instead of just a button Try this code, if it doesn't work, can you share link to a product, we can check easier <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.2/css/all.css" integrity="sha384-vSIIfh2YWi9wW0r9iZe7RJPrKwp6bG+s9QZMoITbCckVJqGCCRhc+ccxNcdpHuYu" crossorigin="anonymous"> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script> $(function() { $('<a href="https://facebook.com"><i class="fab fa-facebook-square"></i></a><a href="https://api.whatsapp.com/send?phone=6588747658"><i class="fab fa-whatsapp"></i></a>').insertAfter(".sqs-add-to-cart-button-wrapper"); }); </script> Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
tuanphan Posted June 4, 2021 Share Posted June 4, 2021 On 5/29/2021 at 10:40 AM, Lestor said: Yup two buttons side by side. But for the fb, I want to use the facebook image icon instead of just a button Let me know if the code work or not ❣️ Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment