WC_REST_Paypal_Standard_Controller::recompute_fees │ private │ WC 1.0

Recompute the fees for the order.

Метод класса: WC_REST_Paypal_Standard_Controller{}

Хуков нет.

Возвращает

void. Ничего (null).

Использование

// private - только в коде основоного (родительского) класса
$result = $this->recompute_fees( $order );
$order(WC_Order) (обязательный)
The order object.

Код WC_REST_Paypal_Standard_Controller::recompute_fees() WC 11.2.1

private function recompute_fees( $order ) {
	WC()->cart->calculate_fees();
	WC()->cart->calculate_shipping();
	WC()->cart->calculate_totals();

	$order->remove_order_items();
	WC()->checkout->set_data_from_cart( $order );
	$order->save();
}