Trying to create a simple function that will display a text note above the "add to cart" button on any page displaying a downloadable product in Woo Commerce. I can get it to work for simple products but not for variations. Can anyone help me adjust this code to work for variable products? Thanks so much.
Here's what I have:
//add text note to product page for all downloadable products
add_action( 'woocommerce_before_add_to_cart_button' , 'append_download_note' );
function append_download_note() {
global $product;
if ( $product->is_downloadable() ) {
echo '<p>Please note: a link to your downloadable product will be
available on the purchase confirmation page.</p>';
}
}