Skip to content

Instantly share code, notes, and snippets.

@dparker1005
Last active June 12, 2019 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dparker1005/7e5ef577fac954ad03461ad19a2ea929 to your computer and use it in GitHub Desktop.
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.
<?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