Hide Download link from account Page in wooCommerce

Viewed 290

I sell Digital Products thru my website. I use the "Free Downloads WooCommerce" Plugin to show the Download option on the product page. Now I want to Hide/disable the Default download link, that appears at the "My-account>Downloads" and "My-account>Orders" tab. is there any way to do that?

1 Answers

You can do this by two ways using woocommerce_account_downloads_columns filter hook or using CSS. check the below code. code goes in your active theme functions.php file.

PHP

function remove_woocommerce_account_downloads_columns( $columns ){
    unset( $columns['download-file'] );
    return $columns;
}
add_filter( 'woocommerce_account_downloads_columns', 'remove_woocommerce_account_downloads_columns', 10, 1 );

CSS

function hide_woocommerce_account_downloads_columns(){
    ?>
    <style type="text/css">
        .download-file{display:none !important;}
    </style>
    <?php
}
add_action( 'wp_head', 'hide_woocommerce_account_downloads_columns', 10, 1 );
Related