AffiliateWP: Add extra payment meta to the exported referrals .csv file

Learn how to add payment meta from Easy Digital Downloads to AffiliateWP’s exported referrals .csv file

An AffiliateWP customer wanted to know how to add some extra payment meta to the exported .csv file from Affiliates → Tools → Export Referrals. For each referral that the .csv listed, they needed to show the customer’s (who the affiliate referred) first name, last name and email address.

Although the code to retrieve the payment meta is specific to Easy Digital Downloads, you can use the reference ID to retrieve the payment meta from whichever e-commerce system you are using with AffiliateWP.

The code

Copy and paste the following code (mind the opening PHP tag) into your child theme’s functions.php or better yet, place this code into a custom plugin.

Milestone sale alerts with Easy Digital Downloads

Get notified via email when one of your downloads reaches a certain number of sales.

The following code snippet will show you how you can be notified via email when one of your downloads reaches a certain number of sales. We needed this recently when AffiliateWP reached its 500th sale. When this milestone was reached, we were able to instantly view the payment of the 500th sale and reward the customer for helping us reach our goal.

Copy and paste the code into your child theme’s functions.php or custom plugin. Change the download ID, and enter your sales milestone and you’re done.