• Resolved Anuj Subedi

    (@h1dd3nsn1p3r)


    I have a question related to the signup fee.

    I have a download, let’s call it Gold Membership. It has an All-access pass, monthly recurring & signup fee enabled. Now I got a scenario where I need to allow users to re-purchase Gold Membership excluding the signup fee.

    Example:

    • Purchasing 1st time $499 now then $125 monthly (includes signup fee).
    • Then if the subscription is expired, allow them to re-purchase the same download within 30 days. The price should be $125 now then $125 monthly.

    How can I exclude the signup fee while repurchasing?

Viewing 1 replies (of 1 total)
  • Plugin Support Mihai Joldis

    (@misulicus)

    Hey @h1dd3nsn1p3r

    It is possible to achieve that but it would require a bit of custom code.
    I put together a small snippet that you can test. It checks if a user is logged in and if they have purchased that specific download before. If they did the Signup fee will be removed.

    Make sure in the code snippet to adjust the $excluded_download variable and set the ID on that line to whatever your Gold Membership download ID is.

    
    function edd_remove_signup_fee_if_purchased( $item ) {
    
    	if ( ! is_user_logged_in() ) {
    		return $item;
    	}
    
    	// Change your Membership ID here for which you wish to remove the Signup Fee.
    	$excluded_download = 405;
    
    	if ( $excluded_download != $item['id'] ) {
    		return $item;
    	}
    
    	if ( isset( $item['options']['recurring']['signup_fee'] ) ) {
    
    		if( edd_has_user_purchased( get_current_user_id(), $item['id'] ) ) {
    			$item['options']['recurring']['signup_fee'] = 0;
    		}
    	}
    
    	return $item;
    }
    add_filter( 'edd_add_to_cart_item', 'edd_remove_signup_fee_if_purchased', 10 );
    
Viewing 1 replies (of 1 total)
  • The topic ‘Exclude Signup Fee During Checkout’ is closed to new replies.