Last active
January 3, 2016 21:59
-
-
Save robskidmore/8525386 to your computer and use it in GitHub Desktop.
Autocomplete Woocommerce order based on payment gateway
This file contains 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
<?php | |
// Update order status based on the id of payment gateway | |
function credit_card_complete_order_status( $order_id ) { | |
$order = new WC_Order( $order_id ); | |
if ( $order->payment_method == 'authorize_net' ) { | |
$order->update_status('completed', 'Automatically Completed'); | |
} | |
} | |
add_action( 'woocommerce_payment_complete', 'credit_card_complete_order_status' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment