Skip to content

Instantly share code, notes, and snippets.

@mircobabini
Created May 27, 2021 08:30
Show Gist options
  • Save mircobabini/fc2867b3034f3b73fc25d8efef4f0415 to your computer and use it in GitHub Desktop.
Save mircobabini/fc2867b3034f3b73fc25d8efef4f0415 to your computer and use it in GitHub Desktop.
function showPayFastNotice(){
jQuery('#pmpro_payfast_before_checkout').show();
}
function hidePayFastNotice(){
jQuery('#pmpro_payfast_before_checkout').hide();
}
jQuery(document).ready(function() {
//detect gateway change
jQuery('input[name=gateway]').click(function() {
var chosen_gateway = jQuery(this).val();
if(chosen_gateway == 'payfast') {
showPayFastNotice();
} else {
hidePayFastNotice();
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment