Skip to content

Instantly share code, notes, and snippets.

@amdrew
Created January 14, 2015 02:04
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save amdrew/e13a2a72de4b46a891ae to your computer and use it in GitHub Desktop.
Save amdrew/e13a2a72de4b46a891ae to your computer and use it in GitHub Desktop.
Easy Digital Downloads - Force account creation by cart total
<?php
/*
* Plugin Name: Easy Digital Downloads - Force account creation by cart total
* Description: Force account creation at checkout if the cart total is a certain amount
* Author: Andrew Munro
* Version: 1.0
*/
function sumobi_edd_force_account_creation_by_cart_total( $ret ) {
// enter the cart total amount that should force account creation
$limit = 100;
// get the cart total
$cart_total = edd_get_cart_total();
if ( $cart_total >= $limit ) {
// if the cart total is greater than or equal to the limit, force account creation
$ret = (bool) true;
}
return $ret;
}
add_filter( 'edd_no_guest_checkout', 'sumobi_edd_force_account_creation_by_cart_total' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment