How can I add another row to the total field in WooCoommerce cart, checkout and recipe mail?

Question

I’ve searched a lot to find out how I can add a custom row inside the total costs in my WooCommerce shop and checked out the hooks but can’t find the solution. This is what I’ve tried:

add_filter( 'woocommerce_get_order_item_totals', 'bbloomer_add_recurring_row_email', 10, 2 );

function bbloomer_add_recurring_row_email( $total_rows, $myorder_obj ) {

$total_rows['recurr_not'] = array(
    'label' => __( 'Rec:', 'woocommerce' ),
    'value' => 'blabla'
);

return $total_rows;
}

But this only adds the row to the total rows in the recipe email. I need to change my total row, add a new row with a name and a value calculated from the cart subtotal field.

This is how I need it:

enter image description here

Do you now how to to this? I have no plan. Thanks for your help!

0
, Johnny97 3 years 2020-06-03T14:10:22-05:00 0 Answers 78 views 0

Leave an answer

Browse
Browse