Created
July 6, 2024 17:48
-
-
Save shameemreza/803e629ae2b85dcdfad59a1b32125257 to your computer and use it in GitHub Desktop.
Autocomplete paid orders for specific payment gateway in WooCommerce.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_payment_complete_order_status', 'wc_auto_complete_paid_order', 10, 3 ); | |
function wc_auto_complete_paid_order( $status, $order_id, $order ) { | |
if ( $order->get_payment_method() === 'stripe' ) { | |
$status = 'completed'; | |
} | |
return $status; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment