Last active
September 18, 2016 15:35
-
-
Save igmoweb/b4f4ac7bcab753f752d1 to your computer and use it in GitHub Desktop.
Appointments+: Automatically trigger Paypal button once confirmation is done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action( 'wp_footer', 'apppointmens_hacks_scripts', 20 ); | |
| function apppointmens_hacks_scripts() { | |
| if ( wp_script_is( 'app-shortcode-confirmation', 'enqueued' ) ) { | |
| ?> | |
| <script> | |
| ( function( $ ) { | |
| $(document).on("app-confirmation-response_received", function() { | |
| var paypalForm = $(".appointments-paypal > form"); | |
| if ( paypalForm.is(":visible") ) { | |
| $(".wait_img").show(); | |
| paypalForm.hide(); | |
| paypalForm.trigger( 'submit' ); | |
| } | |
| }); | |
| })( jQuery ); | |
| </script> | |
| <?php | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment