Display Username of Affiliate when Coupon Applied

After a coupon is applied, how can I display the affiliate it belongs to?

I initially figured the shortcode [referrer_user] would work in the same way, but that seems to only work for the affiliate URLs and not coupons.


Comments

3 responses to “Display Username of Affiliate when Coupon Applied”

  1. Hi Bo,

    At the moment you can’t do it easily. You have to trigger a hook once the coupon is applied which will check the coupon’s name to whom it belongs and return the ID or username, or the affiliate ID and affiliate name if the affiliate is not registered as a user.

    That’s why i suggested to use the affiliates name or ID as a prefix to his/her coupons, ie my coupons should be named gtsiokos-1, gtsiokos-2 etc.

    Hope i cleared things up.
    Cheers

  2. I’m a bit confused by your response.

    Once a customer enters in their Coupon Code, I want it to display their Username. Currently, it applies the coupon, but there is no indication who it belongs to. [referrer_user] still displays Direct after the coupon is applied and not the affiliate’s username. Is there any way to do this?

    I’m also not sure what you mean as in:
    “to display the affiliate’s username, you can use it as a prefix for his/her coupons.”
    The prefix is the same for all affiliate coupons. My coupon prefix is “raise”, so it is outputted as “raise234” or whatever the ID of the affiliate is.
    Can you elaborate on what you meant?

  3. Hi Bo,

    The shortcode [referrer_user] as you can see at the documentation is used to render information about the referring affiliate’s user account.
    At the moment in order to display the affiliate’s username, you can use it as a prefix for his/her coupons.

    Kind regards,
    George

Share