fix call to apply_coupon_fixed_cart_remainder

This commit is contained in:
Mike Jolley 2017-07-28 16:33:02 +01:00
parent c7cb46a524
commit 14717d4ebb
2 changed files with 2 additions and 2 deletions

View File

@ -465,7 +465,7 @@ class WC_Discounts {
}
} elseif ( $amount > 0 ) {
$total_discounted = $this->apply_fixed_cart_discount_remainder( $coupon, $items_to_apply, $amount );
$total_discounted = $this->apply_coupon_fixed_cart_remainder( $coupon, $items_to_apply, $amount );
}
return $total_discount;
}

View File

@ -357,7 +357,7 @@ class WC_Tests_Discounts extends WC_Unit_Test_Case {
$discounts->apply_discount( $coupon );
}
$this->assertEquals( $test['expected_total_discount'], array_sum( $discounts->get_discounts() ), 'Test case ' . $test_index . ' failed (' . print_r( $test, true ) . ' - ' . print_r( $discounts->get_discounts(), true ) . ')' );
$this->assertEquals( $test['expected_total_discount'], array_sum( $discounts->get_discounts_by_item() ), 'Test case ' . $test_index . ' failed (' . print_r( $test, true ) . ' - ' . print_r( $discounts->get_discounts(), true ) . ')' );
// Clean.
WC()->cart->empty_cart();