Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Opening Page in New Window


Lestor

Question

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
  • Answers 6
  • Created
  • Last Reply

Top Posters For This Question

6 answers to this question

Recommended Posts

  • 0

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.

How to: Setup password & share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care - Learn CSS - Custom Popup - Testimonial Slider

I'm Tuan, blogger/owner of a free library for children in Vietnam. Helping the community is a hobby. Contact me via email.

Link to comment
  • 0

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
  • 0
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.

How to: Setup password & share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care - Learn CSS - Custom Popup - Testimonial Slider

I'm Tuan, blogger/owner of a free library for children in Vietnam. Helping the community is a hobby. Contact me via email.

Link to comment
  • 0
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.

How to: Setup password & share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care - Learn CSS - Custom Popup - Testimonial Slider

I'm Tuan, blogger/owner of a free library for children in Vietnam. Helping the community is a hobby. Contact me via email.

Link to comment
  • 0
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.

How to: Setup password & share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care - Learn CSS - Custom Popup - Testimonial Slider

I'm Tuan, blogger/owner of a free library for children in Vietnam. Helping the community is a hobby. Contact me via email.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...