Hi Debeecher,
We modified the Customer History metabox to show things like
Customer age: 4.7 years (since 11 Nov 2019)
Total orders: 32
Total revenue: $12,820.23
Average order value: $400.63
Average order daterange: Every 54 days
we used the filter “wc_get_template” to redirect the customer history template to a self-defined template file in a plugin we may release soon:
add_filter( 'wc_get_template',
function ($template, $template_name, $args) {
if ($template_name === 'order/customer-history.php') {
return plugin_dir_path( __FILE__ ) . 'woocommerce/templates/order/customer-history.php';
}
return $template;
},
10,
3);
In customer-history.php you can place things like Total Revenue, and modify $total_spend as you like:
e.g.
<h4>
<?php
esc_html_e( 'Total revenue', 'woocommerce' );
echo wp_kses_post(
wc_help_tip(
__( "This is the Customer Lifetime Value, or the total amount you have earned from this customer's orders.", 'woocommerce' )
)
);
?>
</h4>
<span class="order-attribution-total-spend">
<?php echo wp_kses_post( wc_price( $total_spend ) ); ?>
</span>