Skip to content

Instantly share code, notes, and snippets.

@igmoweb
Last active September 18, 2016 15:35
Show Gist options
  • Select an option

  • Save igmoweb/b4f4ac7bcab753f752d1 to your computer and use it in GitHub Desktop.

Select an option

Save igmoweb/b4f4ac7bcab753f752d1 to your computer and use it in GitHub Desktop.
Appointments+: Automatically trigger Paypal button once confirmation is done
<?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