Fixing issue with Stripe, Easy Digital Downloads and Terms Checkbox

So what’s the issue?  Well if someone misses that little checkbox to agree to your terms and conditions, the whole page will refresh and all the data (address, credit card) will be lost.  Chances are some customers might be annoyed by this and not complete the purchase.

The team at Easy Digital Downloads are working on a fix, but in the meantime if you add the following code to your checkout page template:

   $(document).ready(function() {  
      $('#edd-purchase-button').on('click', function(event){
         $('#edd_terms_agreement input[type="checkbox"]').each(function(index) {
            if ( ! $(this).is(':checked')) {
               // inject the error message
               if ( $('#edd_error_agree_to_product_terms').length == 0 ) {

Error: You must agree to the terms of use for all products.

'); } event.stopPropagation(); event.preventDefault(); return false; } }); }); }); })(jQuery);

Depending on your theme, you can copy your page.php into page-checkout.php then add the script within a script tag, or use some other method to get the script onto your page. Well worth it to avoid angering (potential) customers!

Looking to learn more about selling plugins with Easy Digital Downloads? You might be interested in my Making Pro Plugins course.