Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

Add “sub-total” column to my-account/orders table

Home / Forums / Virtue Theme / Add “sub-total” column to my-account/orders table

This topic is: Resolved
[Resolved]
Posted in: Virtue Theme
October 7, 2019 at 8:41 am

Hi

I have tried adding a “sub total” column into my-account/order with the following code :

//show sub total in order page

add_filter( 'woocommerce_account_orders_columns', 'add_account_orders_column', 10, 1 );

function add_account_orders_column( $columns ){

$columns['item_subtotal_tax_excl'] = __( 'New Column', '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 ( $value = $order->get_meta( 'item_subtotal_tax_excl' ) ) {

echo esc_html( $value );

}

}

it adds the column but not the sub total, any ideas as to why?

  • The forum ‘Virtue Theme’ is closed to new topics and replies.