Add action to hook onto for order recalculation

This commit is contained in:
Boro Sitnikovski 2018-01-22 15:53:42 +01:00
parent 15e77b30a1
commit af9441fea5
1 changed files with 3 additions and 0 deletions

View File

@ -1437,6 +1437,9 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
$this->set_discount_total( $cart_subtotal - $cart_total );
$this->set_discount_tax( $cart_subtotal_tax - $cart_total_tax );
$this->set_total( round( $cart_total + $fee_total + $this->get_shipping_total() + $this->get_cart_tax() + $this->get_shipping_tax(), wc_get_price_decimals() ) );
do_action( 'woocommerce_order_before_calculate_totals_order_save', $and_taxes, $this );
$this->save();
return $this->get_total();