Skip to content

Instantly share code, notes, and snippets.

@amdrew
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amdrew/9e9a1e727de1aba20289 to your computer and use it in GitHub Desktop.
Save amdrew/9e9a1e727de1aba20289 to your computer and use it in GitHub Desktop.
Easy Digital Downloads - Force user accounts for orders over $0.00 in Easy Digital Downloads
<?php
/**
* Force user accounts for orders over $0.00 in Easy Digital Downloads
*/
function sumobi_edd_force_account_creation( $ret ) {
$cart = function_exists( 'edd_get_cart_total' ) ? edd_get_cart_total() : false;
// if cart has paid products in it, force account creation
if ( $cart ) {
$ret = (bool) true;
}
return $ret;
}
add_filter( 'edd_no_guest_checkout', 'sumobi_edd_force_account_creation' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment