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 | |
/** | |
* Moves and modifies the Gift Aid field. | |
* | |
* 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/ | |
*/ |
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 | |
// Use the below code to simply move the field | |
// =============================================================================== | |
function my_pmproarc_move_checkout_field() { | |
remove_action('pmpro_checkout_boxes', 'pmproarc_pmpro_checkout_boxes', 15); | |
add_action( 'pmpro_checkout_after_level_cost', 'pmproarc_pmpro_checkout_boxes', 5 ); | |
} | |
add_action( 'init', 'my_pmproarc_move_checkout_field' ); | |
// =============================================================================== |
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 | |
/* | |
Custom Tax Example. | |
- Requires PMPro 1.3.13 or higher. | |
- Leave the tax fields blank in the payment settings. | |
- We update the price description to include the tax amount. | |
*/ | |
function my_pmpro_tax($tax, $values, $order) | |
{ | |
$tax = round((float)$values[price] * 0.055, 2); |
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 | |
// Define the groups of levels. array(1,2) means that levels 1 and 2 are in a group and options will be shown for both levels at checkout for those levels. | |
global $pmpro_level_groups; | |
$pmpro_level_groups = array( array( 1,2 ) ); | |
// Show the "Select a Payment Plan" box with options at checkout. | |
function pmpro_level_groups_pmpro_checkout_boxes() { | |
global $pmpro_level_groups, $pmpro_level, $discount_code, $wpdb; | |
// No groups found? return. | |
if ( empty( $pmpro_level_groups) || empty( $pmpro_level ) ) { |
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 | |
// Copy from below here | |
/** | |
* Define payment plans by mapping a level to discount codes representing payment plan options | |
* Useful for offering multiple pricing structures for membership (i.e. Monthly, Annually) | |
* | |
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ |
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 | |
// Copy from below this line | |
function my_pmpro_add_name_placeholder() { | |
?> | |
<script> | |
jQuery("#bfirstname").attr("placeholder", "Type your first name here..."); | |
jQuery("#blastname").attr("placeholder", "Type your last name here..."); | |
</script> |
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 | |
// Copy from below here | |
function my_pmpro_add_name_checkout_hints() { | |
?> | |
<script> | |
jQuery("#bfirstname").parent().append("<p><small class='lite'>I am a hint for first name.</small></p>"); | |
jQuery("#blastname").parent().append("<p><small class='lite'>I am a hint for last name.</small></p>"); | |
</script> |
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 | |
// Copy from below here | |
/** | |
* Stop adding billing fields to everywhere | |
*/ | |
function my_pmproaffl_init() { | |
remove_action( 'init', 'my_pmproaffl_init_include_address_fields_at_checkout', 30 ); | |
} |