From 73961b874a87bc34c894749cd230a0d00aa32ba1 Mon Sep 17 00:00:00 2001 From: Joe Dolson Date: Sat, 25 Nov 2023 11:13:03 -0600 Subject: [PATCH] Improve admin notification of gateway low-purchase toggling --- src/gateways/offline.php | 1 + src/mt-cart.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gateways/offline.php b/src/gateways/offline.php index 053a27af..5b3ab2b4 100644 --- a/src/gateways/offline.php +++ b/src/gateways/offline.php @@ -67,6 +67,7 @@ function mt_setup_offline( $gateways ) { 'notes' => __( 'Offline Payment Notes', 'my-tickets' ), 'selector' => __( 'Gateway selector label', 'my-tickets' ), ), + 'note' => '' . __( 'Purchases less than 50 cents will always go this gateway.', 'my-tickets' ) . '', ); return $gateways; diff --git a/src/mt-cart.php b/src/mt-cart.php index b18b95ec..c4484530 100644 --- a/src/mt-cart.php +++ b/src/mt-cart.php @@ -1060,7 +1060,7 @@ function mt_generate_gateway( $cart ) { $tick_handling = mt_handling_notice(); $other_charges = apply_filters( 'mt_custom_charges', 0, $cart, $mt_gateway ); $other_notices = apply_filters( 'mt_custom_notices', '', $cart, $mt_gateway ); - // If everything in cart is free, don't pass through payment gateway. + // If everything in cart is free or less than 50 cents, don't pass through payment gateway. if ( 0 === (int) ( $total + $shipping_total + $handling_total + $other_charges ) && 'offline' !== $mt_gateway ) { $mt_gateway = 'offline'; }