Advertisement
designbymerovingi

Adjust buyCRED Points Cost

Nov 7th, 2014
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. /**
  2.  * Adjust buyCRED Cost
  3.  * Adjusts the cost for buying points via the
  4.  * buyCRED add-on.
  5.  * @version 1.0
  6.  */
  7. add_filter( 'mycred_buycred_get_cost', 'buyred_volume_pricing', 10, 2 );
  8. function buyred_volume_pricing( $cost, $amount ) {
  9.  
  10.     // If buying 25 points
  11.     if ( $amount == 25 )
  12.         return 25;
  13.  
  14.     // If buying 50 points
  15.     if ( $amount == 50 )
  16.         return 45;
  17.  
  18.     // If buying 100 points
  19.     if ( $amount == 100 )
  20.         return 85.00;
  21.  
  22.     // If buying 200 points
  23.     if ( $amount == 200 )
  24.         return 160.00;
  25.  
  26.     // This is a filter, always return something
  27.     return $cost;
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement