Description
The gravityflowwoocommerce_paid_payment_status filter allows you to customize what status is returned after capturing payment.
See WooCommerce Capture Payment Step for more details.
Parameters
| Parameter | Type | Details |
|---|---|---|
| $status | String | The status to return after payment has been captured. |
| $step | Step | The current step. |
Examples
Change status to completed
By default, we set the payment status to “Processing” after capturing it. You can change it to “Completed” if that’s what you need.
1 2 3 4 5 6 7 8 9 10 | add_filter( 'gravityflowwoocommerce_paid_payment_status', 'my_gravityflowwoocommerce_paid_payment_status', 10, 2 );<br>function my_gravityflowwoocommerce_paid_payment_status( $status, $step ) { //Ensure you are only adjusting the desired form/step if ( $step->get_id() !== 76 ) { return $status; } if ( $step === 'woocommerce_capture_payment' ) { return 'completed'; // Change to completed, the default is processing. } return $status;} |
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?