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

Hi,

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?


Comments

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

  1. Yeah….thanks!!

  2. 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?

    1. Hi,
      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.
      cheers

  3. Hi,
    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.
    cheers

Share