recalculate coupons after adding to order

This commit is contained in:
Ron Rennick 2019-01-26 23:57:32 -04:00
parent 00a93ae8f0
commit d32f189f27
1 changed files with 2 additions and 2 deletions

View File

@ -952,10 +952,10 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
}
$this->set_coupon_discount_amounts( $discounts );
$this->set_item_discount_amounts( $discounts );
$this->save();
// Recalculate totals and taxes.
$this->calculate_totals( true );
$this->recalculate_coupons();
// Record usage so counts and validation is correct.
$used_by = $this->get_user_id();