Last active
June 12, 2019 19:19
-
-
Save dparker1005/7e5ef577fac954ad03461ad19a2ea929 to your computer and use it in GitHub Desktop.
Discounts the price of a membership by $50 when a user pays by check using Paid Memberships Pro and PMPro Pay by Check Add-On. For use in PMPro Customizations Plugin.
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
<?php | |
/** | |
* If a user paid by check, give them a $50 discount. | |
*/ | |
function my_pmpro_discount_with_check( $level ) { | |
if ( 'check' === $_REQUEST['gateway'] ) { | |
$level->initial_payment = $level->initial_payment - 50; | |
// $level->billing_amount = $level->billing_amount - 50; //to update recurring payments too | |
} | |
return $level; | |
} | |
add_filter( 'pmpro_checkout_level', 'my_pmpro_discount_with_check' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment