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 | |
/** | |
* Send the Paid Memberships Pro invoice email on initial checkout for members. | |
* Add this code below into your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function pmpro_after_checkout_send_invoice_email( $user_id, $order ) { | |
$email = new PMProEmail(); | |
$email->sendInvoiceEmail( $user_id, $order ); | |
} |
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 | |
/** | |
* Create 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/ | |
*/ | |
global $pmpro_payment_plans; |
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
<style> | |
@media only screen and (min-width: 1200px) { | |
#pmpro_form h3 { | |
display: grid; | |
grid-template-columns: 2fr 1fr; | |
} | |
.pmpro_checkout .pmpro_checkout-fields .pmpro_checkout-field { | |
clear: left; | |
} | |
.pmpro_checkout .pmpro_checkout-fields .pmpro_checkout-field label { |
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
/* | |
Stop users from setting their username to an email address | |
Add this code to a custom plugin. | |
*/ | |
function pmpro_registration_checks_no_email_user_login($continue) { | |
//if there are earlier problems, don't bother checking | |
if(!$continue) | |
return; | |
//make sure the username passed in doesn't look like an email address (contains a @) |
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 | |
/** | |
* Stop non-members from purchasing products if they do not have an active Paid Memberships Pro Level. | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function stop_non_pmpro_members_from_buying_woo( $is_purchasable, $product ) { | |
// Check if the user has an active membership 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 | |
/** | |
* Remove the replacement homepage from the Member HomePages Add On for Paid Memberships Pro. | |
* | |
* Add this code (L7-L12 only) to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function remove_member_homepages_redirect(){ | |
if ( current_user_can( 'manage_options' ) ) { | |
remove_action( 'template_redirect', 'pmpromh_template_redirect_homepage' ); | |
} |
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 | |
/** | |
* This will adjust membership pricing depending on users current level and level checking out for. See line 10. | |
* This will show you how to adjust the initial amount and/or the recurring amount. If the existing level, in this case 2, is not a recurring level please uncomment lines 12-14. | |
* Add this code (L8 - L20) to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function pmpro_adjust_price_for_members( $level ) { | |
// Adjust price for existing members that currently have Membership level id 1 and are upgrading to Membership Level id 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 | |
/** | |
* Allow customers to select membership duration at checkout. Adjust the amount charged and expiration date of the membership accordingly. | |
* | |
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* | |
* Requires the Paid Memberships Pro Register Helper Add On to be installed and activated in order to work: | |
* https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/ | |
*/ |
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 PHP tag into your code. | |
/** | |
* Adds an extra colum to your Memberships > Orders > Export to CSV file. Displays the group discount code used. | |
* | |
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* | |
* Requires the Paid Memberships Pro Group Discount code Add On to be installed and activated in order to work: | |
* https://www.paidmembershipspro.com/add-ons/group-discount-codes/ | |
*/ |