• Resolved kristofferR

    (@kristofferr)


    I have a web store where I sell digital products. The customer can download the products using links in the Woocommerce interface and in the emails they get.

    However, the emails and the web interface have an useless column with “Expires”, for when the link expires. None of my links expires, so it’s just useless/confusing. See the screenshot here:
    https://kristofferr.com/files/screens/Screenshot%202017-11-06_01-52-47_PM.png

    How can I remove it, both from the emails and the web interface?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter kristofferR

    (@kristofferr)

    I fixed it myself ??

    Paste this into the function.php file of the theme:

    
    // Hide the "Expires" and "Downloads Remaining" columns from emails and My Account
    // My account
    function custom_remove_wc_account_expires_downloads_column($arr) {
        $arr = array(
    		'download-product'   => __( 'Product', 'woocommerce' ),
    		'download-file'      => __( 'Download', 'woocommerce' ),
    		'download-actions'   => ' ',
            );
        return $arr;
    }
    add_filter('woocommerce_account_downloads_columns', 'custom_remove_wc_account_expires_downloads_column');
    
    // Email
    function custom_remove_wc_email_expires_downloads_column($arr) {
        $arr = array(
        	'download-product' => __( 'Product', 'woocommerce' ),
        	'download-file'    => __( 'Download', 'woocommerce' ),
            );
        return $arr;
    }
    
    add_filter('woocommerce_email_downloads_columns', 'custom_remove_wc_email_expires_downloads_column');

    If I wanted to remove only the “Downloads Remaining” column (leaving the Expiry Date column visible) … what would I need to adjust in this code please?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide “Expires” column for downloadable products (both in-store and in emails)’ is closed to new replies.