• Resolved RC Verma

    (@rcverma)


    Hi,

    1) I want to know the Shortcodes for Number of Referral Signup.
    Like there is Shortcode to know the Total Points for Signup Referral: [mycred_total_points ref=”signup_referral” user_id=current]
    Same i want it to know the shortcode for number of referral signup.
    I have searched everywhere didn’t found it anywhere.
    2) I want to show users Content when cbtrkr_approved_inr balance goes above 10 & sign up referral he has made more than 3 or signup referral point could go more than 120.
    below is the shortcode
    [mycred_show_if balance=10 ctype=”cbtrkr_approved_inr” ref=”signup_referral” count=120 comp=”AND”]
    Content
    [/mycred_show_if]
    Can you point me into right direction to put the correct shortcode.

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi @rcverma,
    Thank you for contacting us,
    1) At the moment, The feature to show the Total Points based_on Reference is not available but you can use the mycred_history shortcode to show the History for the specific reference.

    2) Like the conditions, you have shared above you cant achieve this using mycred_if shortcode. You can’t achieve multiple conditions using one reference.

    Hi @rcverma,

    1) You can achieve this by using the shortcode shared below also please have a look at the Documentation URL Shared below.

    [mycred_total_since ref=”signup_referral” from=”2019-01-01″]

    https://codex.mycred.me/shortcodes/mycred_total_since/

    Thread Starter RC Verma

    (@rcverma)

    I have looked it But Mycred total since is what i was not looking for.
    Thanks

    Hi @rcverma,
    The above shortcode we shared it is showing Total Points of the user earned with the signup reference in between the timeframe mentioned in the shortcode. If you are looking for something else then please elaborate on what are you trying to achieve so we can assist you further on this.

    Thanks!

    Thread Starter RC Verma

    (@rcverma)

    I want to know the Shortcodes for Number of Referral Signup.
    Like there is Shortcode to know the Total Points for Signup Referral: [mycred_total_points ref=”signup_referral” user_id=current]
    Same i want it to know the shortcode for number of referral signup.
    Like if a person referred X number of person. & He got Total Points 60 & to know that there is a shortcode([mycred_total_points ref=”signup_referral” user_id=current])
    But I also wanted him to know how many number of Signup referral he has made like
    number of person who has used his referral link to signup.
    I have searched everywhere didn’t found shortcode for this.

    Hope i tried well to let you understand.

    Hi @rcverma,
    You can achieve this by using the mycred_count_ref_instances function please follow the documentation shared below.

    https://codex.mycred.me/functions/mycred_count_ref_instances/

    Thread Starter RC Verma

    (@rcverma)

    Hi,
    Sorry i am not good at coding.
    So i should add below code on theme function.php file

    function mycred_count_ref_instances( $user_id = "";
    $count   = mycred_count_ref_instances( 'signup_referral', $user_id ); )

    Kindly correct it if its wrong.
    & What Shortcode i can use to call the number of referral person.

    HI @rcverma,
    Please add the below shared code in your themes functions.php file.

    function render_mycred_count_ref_instances( $atts ) {
    
    	$attributes = shortcode_atts( array(
    		'user_id' => 'current',
    		'ref' => 'signup_referral',
    	), $atts );
    
    	$user_id = 0;
    
    	if ( $attributes['user_id'] == 'current' ) {
    		$user_id = get_current_user_id();
    	}
    	else {
    		$user_id = intval( $attributes['user_id'] );
    	}
    
    	$ref = sanitize_text_field( $attributes['ref'] );
    
    	$count   = mycred_count_ref_instances( $ref, $user_id );
    
    	return $count;
    }
    add_shortcode( 'mycred_count_instances', 'render_mycred_count_ref_instances' );

    Also, After adding the code Please use the below-mentioned shortcode on the page where you want to show the count prints.

    [mycred_count_instances]

    Thread Starter RC Verma

    (@rcverma)

    This does Solves the issue thank u soo much

    Hi @rcverma,
    We would appreciate a kind and honest review.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Shortcodes for Referral hook & Logic to use’ is closed to new replies.