Skip to content

Commit

Permalink
Improve admin notification of gateway low-purchase toggling
Browse files Browse the repository at this point in the history
  • Loading branch information
joedolson committed Nov 25, 2023
1 parent 1e0dd3b commit 73961b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/gateways/offline.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ function mt_setup_offline( $gateways ) {
'notes' => __( 'Offline Payment Notes', 'my-tickets' ),
'selector' => __( 'Gateway selector label', 'my-tickets' ),
),
'note' => '<em>' . __( 'Purchases less than 50 cents will always go this gateway.', 'my-tickets' ) . '</em>',
);

return $gateways;
Expand Down
2 changes: 1 addition & 1 deletion src/mt-cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down

0 comments on commit 73961b8

Please sign in to comment.