Only Apply Set Up Fee To One Level

Team WPMU,

The first payment level on our network is pretty small. However, we are changing our onboarding flow to simplify it, so when someone upgrades they generally want to get some help setting up their site for more complex tasks. It would be awesome if templates could be applied after site creation, but I know that is unlikely to happen.

To get around this, I would like to apply a set-up fee for those who upgrade from Free to the first level (Basic in our case). I do not want it to apply to anyone who upgrades to a higher level, as those monthly payments are significantly more and I feel that setup for those should be included in the cost.

It doesn't appear that Pro-Sites can do this -- seems to be an "all or nothing" kinda deal. I also don't want to have to direct them to an entirely different payment gateway to hit them with a second charge -- I'd like to just do it all at once.

How can I do this?

Are there any plans to refine Pro-Sites so extra costs can be assigned to specific upgrade levels?

Thanks,
Rob

  • Vaughan

    Hi Rob,

    Hope you're well?

    I haven't tested this, but it could be a lot more involved than this unfortunately & may require a lot more custom coding.

    Can you try the following.

    Open up & edit /wp-content/plugins/pro-sites/pro-sites.php

    Find the following on or around lines 619 - 645

    //determine if a given level has a setup fee for a given blog id
    	function has_setup_fee( $blog_id, $level ) {
    		$setup_fee_amt = ( float ) $this->get_setting( 'setup_fee', 0 );
    
    		if( empty( $blog_id ) && 0 < $setup_fee_amt ) {
    			return true;
    		}
    
    		if ( 0 == $setup_fee_amt ) {
    			return false;
    		} //setup fee not set or is 0
    
    		if ( $this->get_level( $blog_id ) == 0 ) {
    			return true;
    		} //this is a free site. always apply setup fee.
    
    		if ( $this->get_level( $blog_id ) > $level ) {
    			return false;
    		} //customer is downgrading. don't apply setup fee
    
    		if ( ! self::is_trial( $blog_id ) && is_pro_site( $blog_id ) && ! $this->get_setting( 'apply_setup_fee_upgrade', false ) ) {
    			return false;
    		} //this is a pro site, not in trial, and admin doesn't want setup fees applied to upgrades
    
    		return true;
    	}

    Replace it with the following:

    //determine if a given level has a setup fee for a given blog id
    	function has_setup_fee( $blog_id, $level ) {
    		$setup_fee_amt = ( float ) $this->get_setting( 'setup_fee', 0 );
    
    		if( empty( $blog_id ) && 0 < $setup_fee_amt ) {
    			return true;
    		}
    
    		if ( 0 == $setup_fee_amt ) {
    			return false;
    		} //setup fee not set or is 0
    
    		if ( $this->get_level( $blog_id ) == 0 ) {
    			return true;
    		} //this is a free site. always apply setup fee.
    
    		if ( $this->get_level( $blog_id ) <= 2 && $this->get_setting( 'apply_setup_fee_upgrade', false ) ) {
    			return true;
    		} //  Apply setup fee if pro-site level is less than  level
    
            if ( $this->get_level( $blog_id ) > $level ) {
    			return false;
    		} //customer is downgrading. don't apply setup fee
    
    		if ( ! self::is_trial( $blog_id ) && is_pro_site( $blog_id ) && ! $this->get_setting( 'apply_setup_fee_upgrade', false ) ) {
    			return false;
    		} //this is a pro site, not in trial, and admin doesn't want setup fees applied to upgrades
    
    		return true;
    	}

    Where the 2 in the following line is the level at which you will apply fees to, so if the blog level is less than or equal to 2 when upgrading an upgrade fee will be applied.

    if ( $this->get_level( $blog_id ) <= 2 && $this->get_setting( 'apply_setup_fee_upgrade', false ) ) {
    			return true;
    		} //  Apply setup fee if pro-site level is less than  level

    As I say though, I haven't tested this, so it might not work as expected.

    Hope this helps

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.