Show FREE if price is 0
-
Hi,
I found the code below from here and it beautifully changes button text for free downloads :
/** * Easy Digital Downloads * Change the button text of a free download. Default is "Free - Add to Cart" */ function sumobi_edd_free_download_text_args( $args ) { // Enter the button text for a free download $free_download_text = 'Free download'; $variable_pricing = edd_has_variable_prices( $args['download_id'] ); if ( $args['price'] && $args['price'] !== 'no' && ! $variable_pricing ) { $price = edd_get_download_price( $args['download_id'] ); if ( 0 == $price ) { $args['text'] = $free_download_text; } } return $args; } add_filter( 'edd_purchase_link_args', 'sumobi_edd_free_download_text_args' );
But it doesn’t work in variable prices mode (if the price is 0).
Please help
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Show FREE if price is 0’ is closed to new replies.