You appear to be a bot. Output may be restricted
Description
Email template tag: download_list A list of download links for each download purchased
Usage
$string = edd_email_tag_download_list( $payment_id );
Parameters
- $payment_id
- ( int ) required –
Returns
string download_list
Source
File name: easy-digital-downloads/includes/emails/class-edd-email-tags.php
Lines:
1 to 100 of 130
function edd_email_tag_download_list( $payment_id ) { $payment = new EDD_Payment( $payment_id ); $payment_data = $payment->get_meta(); $download_list = '<ul>'; $cart_items = $payment->cart_details; $email = $payment->email; $needs_notes = array(); if ( $cart_items ) { $show_names = apply_filters( 'edd_email_show_names', true ); $show_links = apply_filters( 'edd_email_show_links', true ); foreach ( $cart_items as $item ) { if ( edd_use_skus() ) { $sku = edd_get_download_sku( $item['id'] ); } if ( edd_item_quantities_enabled() ) { $quantity = $item['quantity']; } $price_id = edd_get_cart_item_price_id( $item ); if ( $show_names ) { $title = '<strong>' . get_the_title( $item['id'] ) . '</strong>'; if ( ! empty( $quantity ) && $quantity > 1 ) { $title .= " – " . __( 'Quantity', 'easy-digital-downloads' ) . ': ' . $quantity; } if ( ! empty( $sku ) ) { $title .= " – " . __( 'SKU', 'easy-digital-downloads' ) . ': ' . $sku; } if( ! empty( $price_id ) && 0 !== $price_id ){ $title .= " – " . edd_get_price_option_name( $item['id'], $price_id, $payment_id ); } $download_list .= '<li>' . apply_filters( 'edd_email_receipt_download_title', $title, $item, $price_id, $payment_id ) . '<br/>'; } $files = edd_get_download_files( $item['id'], $price_id ); if ( ! empty( $files ) ) { foreach ( $files as $filekey => $file ) { if ( $show_links ) { $download_list .= '<div>'; $file_url = edd_get_download_file_url( $payment_data['key'], $email, $filekey, $item['id'], $price_id ); $download_list .= '<a href="' . esc_url_raw( $file_url ) . '">' . edd_get_file_name( $file ) . '</a>'; $download_list .= '</div>'; } else { $download_list .= '<div>'; $download_list .= edd_get_file_name( $file ); $download_list .= '</div>'; } } } elseif ( edd_is_bundled_product( $item['id'] ) ) { $bundled_products = apply_filters( 'edd_email_tag_bundled_products', edd_get_bundled_products( $item['id'], $price_id ), $item, $payment_id, 'download_list' ); foreach ( $bundled_products as $bundle_item ) { $download_list .= '<div class="edd_bundled_product"><strong>' . get_the_title( $bundle_item ) . '</strong></div>'; $download_files = edd_get_download_files( edd_get_bundle_item_id( $bundle_item ), edd_get_bundle_item_price_id( $bundle_item ) ); foreach ( $download_files as $filekey => $file ) { if ( $show_links ) { $download_list .= '<div>'; $file_url = edd_get_download_file_url( $payment_data['key'], $email, $filekey, $bundle_item, $price_id ); $download_list .= '<a href="' . esc_url( $file_url ) . '">' . edd_get_file_name( $file ) . '</a>'; $download_list .= '</div>'; } else { $download_list .= '<div>'; $download_list .= edd_get_file_name( $file ); $download_list .= '</div>'; } } } } else { $no_downloads_message = apply_filters( 'edd_receipt_no_files_found_text', __( 'No downloadable files found.', 'easy-digital-downloads' ), $item['id'] ); $no_downloads_message = apply_filters( 'edd_email_receipt_no_downloads_message', $no_downloads_message, $item['id'], $price_id, $payment_id ); if ( ! empty( $no_downloads_message ) ){ $download_list .= '<div>'; $download_list .= $no_downloads_message; $download_list .= '</div>'; } } if ( ! array_key_exists( $item['id'], $needs_notes ) ) { $item_notes = edd_get_product_notes( $item['id'] );