Created
December 22, 2015 17:22
-
-
Save greathmaster/d1fa4b67f6d5218ff1fa to your computer and use it in GitHub Desktop.
Prorate the initial payment. Useful for subscriptions that occur on the first of every month.
This file contains hidden or 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
function my_pmpro_checkout_level($level) | |
{ | |
$current_day = date('j'); | |
$days_in_month = date('t'); | |
$level->initial_payment = $level->initial_payment*(($days_in_month - $current_day)/$days_in_month); | |
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