Skip to content

Instantly share code, notes, and snippets.

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 JarrydLong/2b6f2d67e11ad866d9be05f98b439c0e to your computer and use it in GitHub Desktop.
Save JarrydLong/2b6f2d67e11ad866d9be05f98b439c0e to your computer and use it in GitHub Desktop.
<?php //do not copy
/**
* This recipe will change the level values based on the country and level selected
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*
*/
function my_pmpro_checkout_level( $level ) {
if( !empty( $_REQUEST['level'] ) && $_REQUEST['level'] === 9 ) { //Change to the level that this should apply to
if( !empty( $_REQUEST['bcountry'] ) && $_REQUEST['bcountry'] == 'SV' ){
$level->initial_payment = 29; //Initial amount value
$level->billing_amount = 29; // Recurring amount value
}
}
return $level;
}
add_filter( 'pmpro_checkout_level', 'my_pmpro_checkout_level', 5 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment