This recipe was so useful that we merged it into the Group Discount Codes Add On. When the Add On is activated, a “Group Code” column is added to the CSV export showing the Group Code that was used at checkout (if applicable). The regular Discount Code column will show the main/parent discount code.
You can grab the Group Discount Codes Add On that includes this feature here. If you are interested in how this works to possibly do something similar via custom code, we’ve kept the original code recipe here for reference.
About the Code Recipe
The Group Discount Codes Add On for Paid Memberships Pro allows you to see the number of times the ‘parent’ discount code was used on the Memberships > Discount Codes admin page. However, you might want to know which individual ‘child’ group discount codes have been used and by whom.
If you’re new to the Group Discount Codes Add On, it adds features to PMPro to better manage large numbers of unique discount codes with the same pricing. For example, it can be used to create a group of codes to print on promotional material, for use in a campaign with Groupon or for an email campaign.
You can use the following code recipe to add an extra CSV column called
group_code to your Orders CSV download file. Inside of this new column, you will be able to see which individual group codes have been used and by which member. To access and download your Orders CSV file, navigate to your WordPress Dashboard > Memberships > Orders > Export to CSV.
We are currently working on better reports for Discount Codes in the core Paid Memberships Pro plugin as well as specialized reports for viewing activity on your Group Discount Codes. This code recipe
will help membership sites already using the Group Discount Codes Add On to have better visibility of code uses. is already merged into the Add On, but you can view the code recipe below for reference. Let us know if you have any other ideas for this Add On or discount codes in general.