Skip to content

Commit

Permalink
Fix #119
Browse files Browse the repository at this point in the history
Fixed fatal error when max total fee and total discounts are empty.
  • Loading branch information
nidhitatosaniya committed Jan 17, 2023
1 parent 2c59e90 commit 002c45b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/class-alg-wc-checkout-fees.php
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,10 @@ public function calculate_the_fee( $args, $final_fee_to_add, $total_in_cart, $fe
$new_fee = $max_fee;
}
// Max total discount.
if ( empty( $this->max_total_all_discounts ) || empty( $this->max_total_all_fees ) ) {
$this->max_total_all_discounts = 0;
$this->max_total_all_fees = 0;
}
if ( false !== $this->max_total_all_discounts ) {
if ( $new_fee < $this->max_total_all_discounts ) {
$new_fee = $this->max_total_all_discounts;
Expand Down

0 comments on commit 002c45b

Please sign in to comment.