Skip to content

Commit e847c98

Browse files
authored
Merge pull request #48 from themeum/discount-type-issue-for-sub-single-checkout
Fix(🛠️) : Discount issue when a cart contains both subscription and single-order
2 parents 2719b3d + 4b3a286 commit e847c98

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

inc/SalesData/WooToNative/Helper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ public static function filter_subscription_order_item( $tutor_order_data, $order
245245
$tutor_order_data['pre_tax_price'] = $order->get_subtotal();
246246
$tutor_order_data['tax_amount'] = $order->get_total_tax();
247247
$tutor_order_data['net_payment'] = $order->get_total() - $order->get_total_refunded();
248-
$tutor_order_data['coupon_amount'] = $order->get_discount_total();
249-
$tutor_order_data['discount_amount'] = $order->get_discount_total();
248+
$tutor_order_data['coupon_amount'] = $tutor_order_data['coupon_amount'] ?? $order->get_discount_total();
249+
$tutor_order_data['discount_amount'] = $tutor_order_data['discount_amount'] ?? $order->get_discount_total();
250250
$tutor_order_data['fees'] = $order->get_total_fees();
251251
$tutor_order_data['earnings'] = ( $order->get_total() - $order->get_total_refunded() ) - $order->get_total_fees();
252252
$tutor_order_data['refund_amount'] = $order->get_total_refunded();

0 commit comments

Comments
 (0)