Skip to content

Commit

Permalink
fix(data-events): ensure get_last_successful_order returns WC_Order
Browse files Browse the repository at this point in the history
  • Loading branch information
dkoo committed Aug 2, 2024
1 parent aebe581 commit 222f58c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public static function get_last_successful_order( $customer ) {
// Prioritize any currently active subscriptions.
$active_subscriptions = self::get_active_subscriptions_for_user( $user_id );
if ( ! empty( $active_subscriptions ) ) {
return reset( $active_subscriptions );
return \wcs_get_subscription( reset( $active_subscriptions ) );
}

// If no active subscriptions, get the most recent completed order.
Expand Down

0 comments on commit 222f58c

Please sign in to comment.