Replace the wc-class woocommerce function – WordPress Development Stack Exchange

I'm not good at WP and plugins and I'll need help here. I have read that it is possible to alter some basic WC functions with filters and action, but I probably did not understand it correctly. I want to simply delete the shipping price of the page of my cart Total price field.

The function that is in woocommerce / includes / class-wc-cart-totals.php is:

protected function calculos_totals () {
$ this-> set_total (& # 39 ;, total & # 39 ;, round ($ this-> get_total (& # 39; items_total & # 39 ;, true) + $ this-> get_total (& # 39; fees_total & # 39 ;, true) + $ this-> get_total (& # 39; shipping_total & # 39 ;, true) + array_sum ($ this-> get_merged_taxes (true)), 0));
$ this-> cart-> set_total_tax (array_sum ($ this-> get_merged_taxes (false)));

// Allow add-ons to snag and alter totals before calculating the final total.
if (has_action (& # 39; woocommerce_calculate_totals & # 39;)) {
do_action (& # 39; woocommerce_calculate_totals & # 39 ;, $ this-> cart);
}

// Allow the add-ons to filter the grand total and add the cart totals in case of modifications.
$ this-> cart-> set_total (max (0, apply_filters (& # 39; woocommerce_calculated_total & # 39 ;, $ this-> get_total (& # 39; total & # 39;), $ this-> cart)));
}

I tried to copy it in my son theme function.php file like this:

add_action (& # 39; Calculate_totals & # 39 ;, & # 39; my_calculate_totals & # 39;);

my_calculate_totals () function
{
$ this-> set_total (& # 39 ;, total & # 39 ;, round ($ this-> get_total (& # 39; items_total & # 39 ;, true) + $ this-> get_total (& # 39; fees_total & # 39 ;, true) + array_sum ($ this-> get_merged_taxes (true)), 0));
$ this-> cart-> set_total_tax (array_sum ($ this-> get_merged_taxes (false)));

// Allow add-ons to snag and alter totals before calculating the final total.
if (has_action (& # 39; woocommerce_calculate_totals & # 39;)) {
do_action (& # 39; woocommerce_calculate_totals & # 39 ;, $ this-> cart);
}

// Allow the add-ons to filter the grand total and add the cart totals in case of modifications.
$ this-> cart-> set_total (max (0, apply_filters (& # 39; woocommerce_calculated_total & # 39 ;, $ this-> get_total (& # 39; total & # 39;), $ this-> cart)));
}

Does not work is possible?

My goal is to simply remove this from the first line.

$ this-> get_total (& # 39; shipping_total & # 39 ;, true)