Create a gist now

Instantly share code, notes, and snippets.

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