"buyCred" different Packages prices

front page Forums Community "buyCred" different Packages prices

This topic contains 5 replies, has 5 voices, and was last updated by Avatar Fulgore Dragonslayer 11 months, 1 week ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #8058

    I need to set up 6 different price packages with “buyCred”

    1 cred = $9.99
    6 creds = $49.99
    20 creds = $149.99

    2 creds = $20
    4 creds = $35
    6 creds = $50

    how can I go about doing this ?
    Is there some documentation that shows how to do this ?


    Hey Jimmy.

    By default, buyCRED applies one specific exchange rate for each point type you want to sell. So if you want to give discounts for larger purchases there is no built-in solution for this.

    There are however two things you can do:

    A. Hook into mycred_buycred_get_cost which allows you to change the cost of a purchase. You could use this to apply discounts based on how many points a user wants to buy and for which point type.

    B. Apply “bonus” points when a user completes a purchase. So when I go and buy 10 points for 100USD for example, I also get 20 points extra under a separate log entry. Here is a forum post on this topic.


    Sorry to be completely green, but where exactly do I “Hook into mycred_buycred_get_cost”, ie what file do I add the extra code to?

    Also, link to the ‘B’ solution 404’s.


    @ruby – If you decide to use the mentioned hook (as for example shown in any of the examples) then that code goes into your theme’s functions.php file.

    Regarding option B, here is an example where we give a user 10 points extra when they complete a purchase (no matter which gateway or amount bought):

    add_filter( 'mycred_add_finished', 'mycred_pro_pay_bonus_points_on_purchase', 10, 3 );
    function mycred_pro_pay_bonus_points_on_purchase( $result, $request, $mycred ) {
    	if ( $result === false || substr( $request['ref'], 0, 15 ) != 'buy_creds_with_' ) return $result;
    	extract( $request );
    	$mycred->update_users_balance( $user_id, 10, $type );
    		'Bonus %plural%'
    	return $result;

    I would like to mambers who buy:
    1. 100 points – no bonus.
    2. 200 points have bonus 50 points.
    3. 500 points have bonus 200 points.
    4. 1000 points have bonus 500 points.

    It is possible?

    Fulgore Dragonslayer

    Is it possible to reward for 100points purchase, 10 free custompoints?

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.