Skip to content

Instantly share code, notes, and snippets.

@amdrew
Last active August 29, 2015 14:00
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/11336588 to your computer and use it in GitHub Desktop.
Save amdrew/11336588 to your computer and use it in GitHub Desktop.
Easy Digital Downloads - Force account creation for specific price ID
<?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