Skip to content

Instantly share code, notes, and snippets.

@amdrew
Last active November 2, 2018 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amdrew/7424283 to your computer and use it in GitHub Desktop.
Save amdrew/7424283 to your computer and use it in GitHub Desktop.
Filter the download title in the email to include the price, and quantity. EDD 1.9+ only
<?php
function sumobi_custom_email_receipt_download_title( $title, $item, $price_id ) {
$price = $item['price'];
$quantity = $item['quantity'];
// only show quantity if quantities are enabled
$quantity = edd_item_quantities_enabled() ? ' (quantity: ' . $quantity . ')' : '';
// append price and quantity to title
// Download Title – $50.00 (quantity: 5)
$title .= edd_currency_filter( edd_format_amount( $price ) ) . $quantity;
return $title;
}
add_filter( 'edd_email_receipt_download_title', 'sumobi_custom_email_receipt_download_title', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment