Created
July 30, 2014 09:42
-
-
Save Apina/859114d98ef18b77bd32 to your computer and use it in GitHub Desktop.
This should no longer be required after 4.6.4 as there is an option in the Gateway settings -- Adds a little jQuery to automatically open the Payment options.
This file contains 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 | |
/* | |
Plugin Name: EE adds JavaScript to show the payment options automatically. | |
Description: EE adds JavaScript to show the payment options automatically. | |
*/ | |
/* Begin Adding Functions Below This Line */ | |
function ee_1() { | |
if(is_singular()) { | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function() { | |
jQuery('#spco-go-to-step-payment_options-btn').click(function() { | |
if (jQuery('.reg-page-payment-option-dv').length == 1) { | |
setTimeout(function(){jQuery('.reg-page-payment-option-dv').click();}, 2000); | |
} | |
}); | |
}); | |
</script> | |
<?php | |
} | |
} | |
add_action('wp_footer', 'ee_1', 100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment