From af75a03100a95323ff50abb481522878ac7e1302 Mon Sep 17 00:00:00 2001 From: David Parker Date: Mon, 29 Jul 2024 08:48:41 -0400 Subject: [PATCH] Fix free gateway purchases for 2Checkout --- classes/gateways/class.pmprogateway_twocheckout.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/classes/gateways/class.pmprogateway_twocheckout.php b/classes/gateways/class.pmprogateway_twocheckout.php index 11009e28f..17db41d6a 100644 --- a/classes/gateways/class.pmprogateway_twocheckout.php +++ b/classes/gateways/class.pmprogateway_twocheckout.php @@ -227,6 +227,12 @@ static function pmpro_checkout_before_change_membership_level($user_id, $morder) if(empty($morder)) return; + // If this isn't a 2Checkout order, bail. + if ( 'twocheckout' !== $morder->gateway ) { + return; + } + + $morder->user_id = $user_id; $morder->saveOrder();