You appear to be a bot. Output may be restricted
Description
Retrieves the final price of a downloadable product after purchase this price includes any necessary discounts that were applied
Usage
$string = edd_get_download_final_price( $download_id, $user_purchase_info, $amount_override );
Parameters
- $download_id
- ( int ) required – ID of the download
- $user_purchase_info
- ( array ) required – an array of all information for the payment
- $amount_override
- ( string ) optional – a custom amount that over rides the 'edd_price' meta, used for variable prices
Returns
string the price of the download
Source
File name: easy-digital-downloads/includes/download-functions.php
Lines:
1 to 17 of 17
function edd_get_download_final_price( $download_id, $user_purchase_info, $amount_override = null ) { if ( is_null( $amount_override ) ) { $original_price = get_post_meta( $download_id, 'edd_price', true ); } else { $original_price = $amount_override; } if ( isset( $user_purchase_info['discount'] ) && $user_purchase_info['discount'] != 'none' ) { // if the discount was a %, we modify the amount. Flat rate discounts are ignored if ( edd_get_discount_type( edd_get_discount_id_by_code( $user_purchase_info['discount'] ) ) != 'flat' ) $price = edd_get_discounted_amount( $user_purchase_info['discount'], $original_price ); else $price = $original_price; } else { $price = $original_price; } return apply_filters( 'edd_final_price', $price, $download_id, $user_purchase_info ); }