Easy Digital Download - Getting javascript error: An invalid form control with name='card_name' is not focusable

Are you getting this JavaScript error while clicking Complete Purchase button?

An invalid form control with name='card_name' is not focusable.

I was getting this this error after user applies their promo code.

In order to fix this just add this to your functions.php file and you should be good.

<?php
/**
 * Plugin Name: Easy Digital Downloads Discount Patch
 */
add_action( 'wp_footer', function() {
?>
<script>
jQuery( function() {
	jQuery( document.body ).on( 'edd_discount_applied', function() {
		window.location.reload();
	} );
} );
</script>
<?php
} );

Let me know if you have any question on this.

Copyright © 2021 Crunchify, LLC.  •  Pro Services  •  Contact  •  Hosted at DiscourseHosting.