Last active
November 2, 2018 19:50
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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