Skip to content

Instantly share code, notes, and snippets.

@giucu91
Created November 16, 2020 08:25
Show Gist options
  • Save giucu91/eb733130cf9f0d6e3a3009959df77288 to your computer and use it in GitHub Desktop.
Save giucu91/eb733130cf9f0d6e3a3009959df77288 to your computer and use it in GitHub Desktop.
Paypal validations
var options = {
buttons: ['edd-purchase-button'],
environment: 'production',
condition: function () {
var valid = true;
if ($('#edd-email').val() == '') {
valid = false;
}
$('#edd_purchase_form input.required').each(function() {
if($(this).val() == '') {
valid = false;
}
});
if($('#edd_agree_to_terms').length) {
if (!$('#edd_agree_to_terms').is(':checked')) {
valid = false;
}
}
return valid;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment