how to use action “affiliates_referral” with parameter “$referral_id”?

Posted in


I would like to add the referral ID as a WooCommerce order “custom field” (metadata).

I found this action: “affiliates_referral” with the parameter “$referral_id”

How do you add the action to an order? In the functions.php file?

4 Responses to how to use action “affiliates_referral” with parameter “$referral_id”?

  1. Clemens December 31, 2014 at 10:08 am #


  2. Clemens December 30, 2014 at 12:06 pm #

    Thanks! It works great, but the referral_id is shown as a number of 4 digits and I only have id’s from 1 to 40. How can you match the id’s? Is is possible to show the referral name?

    • antonio December 31, 2014 at 9:01 am #

      Referral hasn’t name, “referral” is similar to commission, I think you are talking about “affiliate”.
      Please download the new version 1.1 where affiliate info is displayed too.

  3. antonio December 30, 2014 at 11:34 am #

    You can use Affiliates Woocommerce Metabox plugin to display a metabox in the order page. If you need to display it somewhere else , you can use the code as a reference.

We use cookies to optimize your experience on our site and assume you're OK with that if you stay.
OK, hide this message.

Affiliates · Contact · Jobs · Terms & Conditions · Privacy Policy · Documentation · Downloads · Useful Plugins · My Account