Filters

edd_purchase_form_required_fields

The edd_purchase_form_required_fields filter is used to change which fields during checkout are required. For an example, see this doc.

Change Default Country for Billing Fields

Some payment gateways require that billing info, including country, be filled out. When using one of these gateways, you may want to change the country that is selected by default. This small code snippet will let you do that. The snippet should be added to a custom plugin or your theme’s functions.php file: function pw_set_edd_default_country( […]

edd_update_discount

This filter is applied to the discount data just before a discount is created. apply_filters( ‘edd_insert_discount’, $discount_details); $discount_details is an array of all fields for the discount.

edd_update_discount

This filter is applied to the discount data before a discount code is updated. apply_filters( ‘edd_update_discount’, $discount_details, $id ); $discount_details is an array of all fields for the discount.

Custom Email Templates

Whenever a purchase is made, an email receipt is sent to the buyer. The way this email appears to the buyer can be easily customized using the email templating engine in EDD.

Change Global Download Labels

The global labels, Download and Downloads, used throughout Easy Digital Downloads are extremely easy to change. Just use the simple filter function shown below:

Modify the Download Post Type Admin Labels

You can easily change the labels of the Downloads post type by placing a simple function in your theme’s functions.php, or any custom plugin. You might, for example, want to change “Downloads” to “Music”, or perhaps to “Products”.

edd_purchase_receipt

This filter can be used to modify the purchase receipt email that is sent to users after purchasing downloads.

edd_cart_item

The HTML for each item in the shopping cart (except on the checkout page) is passed through this filter. The filter includes one parameter, $item, which is a string containing the HTML code for the cart item. Each cart item is wrapped in <li> tags.

edd_empty_cart_message

This filter is used when displaying the “your cart is empty” message and can be used to modify the message that is displayed. The sample below shows an example of how you could modify it: