Last active
December 17, 2015 17:59
-
-
Save strangerstudios/5650417 to your computer and use it in GitHub Desktop.
Credit one level's cost to another level at checkout with PMPro.
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
/* | |
Upgrade Pricing. Make sure to change "$level->id == 15" to check for your own level ID. | |
*/ | |
function my_pmpro_checkout_level($level) | |
{ | |
$user_level = pmpro_getMembershipLevelForUser(); | |
//if($level->id == 15 && pmpro_hasMembershipLevel(6)) //to check for a specific level combo | |
if(!empty($user_level->initial_payment)) | |
{ | |
max(0, $level->initial_payment = $level->initial_payment - $user_level->initial_payment); | |
} | |
return $level; | |
} | |
add_filter("pmpro_checkout_level", "my_pmpro_checkout_level"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment