I am trying to add a few columns to the WooCommerce > my account > orders page.
So far the code below adds more than one column but the content of the columns are not showing, where I'm I getting it wrong?
add_filter( 'woocommerce_account_orders_columns', 'add_account_orders_column', 10, 1 );
function add_account_orders_column( $columns ){
unset($columns['order-total']);
$columns['custom-column'] = __( 'New Column', 'woocommerce' );
$columns['custom-column2'] = __( 'New Column 2', 'woocommerce' );
return $columns;
}
add_action( 'woocommerce_my_account_my_orders_column_custom-column', 'add_account_orders_column_rows' );
function add_account_orders_column_rows( $order ) {
// Example with a custom field
if( $columns == 'custom-column' ) {
echo 'Hello';
}
if( $columns == 'custom-column2' ) {
echo 'Hello 2';
}
}