MemberPress: Assigning BuddyPress Member Type on Membership Signup
add_action(‘mepr_event_member_signup_completed’, function($event) { $user = $event->get_data(); bp_set_member_type($user->ID, ‘member_type’); });Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_action(‘mepr_event_member_signup_completed’, function($event) { $user = $event->get_data(); bp_set_member_type($user->ID, ‘member_type’); });Continue reading
function mepr_product_price($product_price, $coupon_code, $product) { if ($product->ID === 123) { $product_price = 50; } return $product_price; } add_filter(‘mepr_adjusted_price’, ‘mepr_product_price’, 10, 3);Continue reading
PayPal JS SDK Standard IntegrationContinue reading
document.addEventListener(‘DOMContentLoaded’, function () { // Select the First Name field var firstNameField = document.querySelector(‘#billing_first_name’); var lastNameField = document.querySelector(‘#billing_last_name’); if (firstNameField) { firstNameField.addEventListener(‘change’, function () { var fullName = firstNameField.value.trim(); var nameParts = fullName.split(‘ ‘); // Extract First Name and Last…Continue reading
function pw_edd_prevent_duplicate_purchase( $valid_data, $posted ) { $cart_contents = edd_get_cart_contents(); foreach( $cart_contents as $item ) { if( edd_has_user_purchased( get_current_user_id(), $item[‘id’] ) ) { edd_set_error( ‘duplicate_item’, ‘You have already purchased this item so may not purchase it again’ ); } } }…Continue reading
function mepr_cust_tax_only_uk( $tax_rate, $country, $state, $postcode, $city, $street, $user, $prd_id ) { if ( $country != ‘GB’ ) { $tax_rate->tax_rate = 0.0; } return $tax_rate; } add_filter( ‘mepr_find_tax_rate’, ‘mepr_cust_tax_only_uk’, 99, 8 );Continue reading
//Turn off Auto rebill for offline gateway if a transactions expires function turn_off_auto_rebill_offline_gateway( $txn, $sub_status ) { if ( $txn->payment_method() instanceof MeprArtificialGateway && $sub = $txn->subscription() ) { $sub->status = MeprSubscription::$cancelled_str; $sub->store(); } } add_action( ‘mepr_transaction_expired’, ‘turn_off_auto_rebill_offline_gateway’, 9, 2 );…Continue reading
function mepr_fallback_failed_txn( $txn ) { MeprGroupsCtrl::create_fallback( $txn ); } add_action( ‘mepr_txn_status_failed’, ‘mepr_fallback_failed_txn’ );Continue reading
function mepr_extend_renewal_grace_days( $days ) { return 1; } add_filter( ‘mepr_grace_expire_days’, ‘mepr_extend_renewal_grace_days’ );Continue reading
function mepr_extend_grace_period() { return 7; } add_filter( ‘mepr_grace_init_days’, ‘mepr_extend_grace_period’ );Continue reading