Skip to content

Commit a044edf

Browse files
authored
Get $order in checkout mutation (#605)
* make order processing methods static * get order for graphql_woocommerce_after_checkout action and catch block
1 parent 6dbdcb5 commit a044edf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

includes/mutation/class-checkout.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ public static function mutate_and_get_payload() {
150150
throw new UserError( $order_id->get_error_message( 'checkout-error' ) );
151151
}
152152

153+
$order = \WC_Order_Factory::get_order( $order_id );
153154
/**
154155
* Action called after checking out.
155156
*
@@ -158,7 +159,7 @@ public static function mutate_and_get_payload() {
158159
* @param AppContext $context Request AppContext instance.
159160
* @param ResolveInfo $info Request ResolveInfo instance.
160161
*/
161-
do_action( 'graphql_woocommerce_after_checkout', $order_id, $input, $context, $info );
162+
do_action( 'graphql_woocommerce_after_checkout', $order, $input, $context, $info );
162163

163164
return array_merge( array( 'id' => $order_id ), $results );
164165
} catch ( Exception $e ) {

0 commit comments

Comments
 (0)