• Resolved Nate1

    (@nate1)


    Hello, I’m trying to find documentation on how to modify the columns for the WC Admin Customer List. “wp-admin/admin.php?page=wc-admin&path=%2Fcustomers”

    Much like:
    add_filter( ‘manage_users_columns’, ‘theme_modify_admin_users_columns’ );

    Where would I find the appropriate documentation?

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Howdy.

    We haven’t heard back from you in a while, so I’m going to go ahead and mark this thread as resolved. If you have any other questions please start a new thread.

    Cheers!

    Thread Starter Nate1

    (@nate1)

    Sorry havn’t gotten back to this task yet,

    Looks like this is what I need,

    
    const addTableColumn = reportTableData => {
        if ( 'orders' !== reportTableData.endpoint ) {
            return reportTableData;
        }
     
        const newHeaders = [
            {
                label: 'Currency',
                key: 'currency',
            },
            ...reportTableData.headers,
        ];
        const newRows = reportTableData.rows.map( ( row, index ) => {
            const item = reportTableData.items.data[ index ];
            const newRow = [
                {
                    display: item.currency,
                    value: item.currency,
                },
                ...row,
            ];
            return newRow;
        } );
     
        reportTableData.headers = newHeaders;
        reportTableData.rows = newRows;
     
        return reportTableData;
    };
     
    addFilter( 'woocommerce_admin_report_table', 'dev-blog-example', addTableColumn );

    Thsnk you

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Customizing Customer Columns in Admin’ is closed to new replies.