Filter Easy Digital Downloads Singular Product Price

You can filter the Easy Digital Downloads singular product page price output using the conversions_edd_singular_price hook. Below is a code example to accomplish this..

Code Example

/**
 * Filter Easy Digital Downloads singular product price.
 *
 * @param string $price Price string.
 */
add_filter('conversions_edd_singular_price', 'conversions_edd_change_singular_price');
function conversions_edd_change_singular_price( $price ) {

    // Get the download ID.
	$download_id = get_the_ID();

    // Change free download price text.
	if ( edd_is_free_download( $download_id ) ) {
		$price = '<h3 id="edd-price-' . esc_attr( $download_id ) . '" class="edd-price">' . esc_html__( 'No Price', 'conversions' ) . '</h3>';
	} 

    return $price;
}