Last active
August 29, 2015 14:00
-
-
Save amdrew/11336588 to your computer and use it in GitHub Desktop.
Easy Digital Downloads - Force account creation for specific price ID
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Force account creation for a specific price ID | |
*/ | |
function sumobi_edd_force_account_creation( $ret ) { | |
// The 3rd pricing option for a download with an ID of 123 ( 0 = first, 1 = second, 2 = third etc ) | |
if ( edd_item_in_cart( '123', array( 'price_id' => 2 ) ) ) { | |
$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