Created
June 15, 2021 06:53
-
-
Save JarrydLong/2b6f2d67e11ad866d9be05f98b439c0e to your computer and use it in GitHub Desktop.
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 //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