• Resolved Edith Allison

    (@terragirl)


    Hi,

    I’m building a plugin extension to add my own columns to the “products” report. Data is displaying fine in the table, but I’m stuck at how to add a summary at bottom of table.

    So far I’ve got the following (based on the extension example, using the “woocommerce_admin_report_table” filter):

        const newSummary = [
    	    ...reportTableData.summary,
    	    {
    		    label: 'Cost',
    		    value: '100', // ?
    	    },    	    
    	]; 
    
     
         reportTableData.summary = newSummary; 

    “Cost” is a field I’m getting from the DB, it shows correctly in the table column, but in summary I’m getting an “unknown” error. For my test, I’ve therefore entered a default “100” as value.

    Query: How can I add the actual sum total of “Cost” to the table?

    Many thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to add custom column to “Summary”’ is closed to new replies.