The WooCommerce My Account > Downloads endpoint features a table which lists the available downloads. This table has 4 default columns: Product, Downloads remaining, Expires, Download (as you can see from the screenshot below).
Now, it’s very likely you may want to rename these headings into something more readable or understandable. On top of that, you may want to change the content of whatever column – you’ll find a workaround for this as well. Enjoy!
PHP Snippet: Rename Downloads Table Headers @ WooCommerce My Account
/**
* @snippet Rename Downloads Table Header @ WooCommerce My Account
* @how-to businessbloomer.com/woocommerce-customization
* @author Rodolfo Melogli, Business Bloomer
* @compatible WooCommerce 6
* @community https://businessbloomer.com/club/
*/
add_filter( 'woocommerce_account_downloads_columns', 'bbloomer_rename_downloads_page_columns' );
function bbloomer_rename_downloads_page_columns( $cols ) {
$cols['download-remaining'] = 'New Title';
return $cols;
}
You can also rename ‘download-product’, ‘download-expires‘ and ‘download-file‘ array values.
Bonus PHP Snippet: Custom Downloads Table Content @ WooCommerce My Account
On top of editing the table headers, you can also print whatever you want inside one of the 4 columns. All you need to remember are the 4 column IDs: ‘download-product’, ‘download-remaining‘, ‘download-expires‘ and ‘download-file‘ as the WooCommerce action hook has the following format: ‘woocommerce_account_downloads_column_COLUMNID‘ e.g. ‘woocommerce_account_downloads_column_download-remaining‘
/**
* @snippet Downloads Table Column Content @ WooCommerce My Account
* @how-to businessbloomer.com/woocommerce-customization
* @author Rodolfo Melogli, Business Bloomer
* @compatible WooCommerce 6
* @community https://businessbloomer.com/club/
*/
add_action( 'woocommerce_account_downloads_column_download-remaining', 'bbloomer_ex_downloads_remaining_column_content' );
function bbloomer_ex_downloads_remaining_column_content( $download ) {
echo 'Test';
}