Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Give Bonus Points - buyCRED Stripe
- * @version 1.1
- */
- add_filter( 'mycred_run_this', 'mycredpro_payout_bonus_points', 10, 2 );
- function mycredpro_payout_bonus_points( $run_this, $mycred ) {
- // Only applicable for stripe point purchases
- if ( $run_this['ref'] != 'buy_creds_with_stripe' ) return $completed;
- // Get the bonus amount the user should get based on the amount of points
- // they just bought.
- // User bought 500 points ( $ 5.00 ) - give 10 %
- if ( $run_this['amount'] == 500 )
- $run_this['amount'] *= 1.1;
- // User bought 1000 points ( $ 10.00 ) - give 20 %
- elseif ( $run_this['amount'] == 500 )
- $run_this['amount'] *= 1.2;
- // User bought 1500 points ( $ 15.00 ) - give 25 %
- elseif ( $run_this['amount'] == 500 )
- $run_this['amount'] *= 1.25;
- // User bought 2000 points ( $ 20.00 ) - give 50 %
- elseif ( $run_this['amount'] == 500 )
- $run_this['amount'] *= 1.5;
- // User bought 5000 points ( $ 50.00 ) - give 100 %
- elseif ( $run_this['amount'] == 500 )
- $run_this['amount'] *= 2;
- return $run_this;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement