Advertisement
wpgenie

buy now js confirmation

Oct 12th, 2018
728
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. //BUY NOW confirmation JS
  2.  
  3. function print_my_secondline_script() {
  4.   if ( is_product()) {
  5.         ?>
  6.         <script type="text/javascript">
  7.             jQuery('.single_add_to_cart_button.button').click(function() {
  8.                 var c = confirm("Click OK to continue?");
  9.                 return c; //you can just return c because it will be true or false
  10.             });
  11.         </script>
  12.         <?php
  13.   }
  14. }
  15. add_action( 'wp_footer', 'print_my_secondline_script' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement