I'm trying to programmatically change the shipping price for an order. I've tried code similar to the following in my woocommerce_order_status_processing
action hook function. I got the shipping total to update, but not the actual line item for FedEx. I'm using pluginhive's FedEx shipping plugin. Is there a way to update the FedEx value as well as the total?
$shipping = $order->get_shipping_total();
$new_shipping = 1.00;
$order->set_shipping_total($new_shipping);
$order->save();
$order->calculate_shipping();
$order->calculate_totals();