Skip to content

Instantly share code, notes, and snippets.

@patrickposner
Created July 24, 2018 08:17
Show Gist options
  • Select an option

  • Save patrickposner/3e0ba803fc23cb4d9f504c401748160a to your computer and use it in GitHub Desktop.

Select an option

Save patrickposner/3e0ba803fc23cb4d9f504c401748160a to your computer and use it in GitHub Desktop.
// Bestellstatus nach Stripe->Sofortüberweisung direkt auf fertiggestellt
add_action( 'woocommerce_thankyou', 'sofort_force_order_complete', 10, 1 );
function sofort_force_order_complete( $order_get_id ) {
$order = new WC_Order($order_get_id);
if($order->get_payment_method() == 'stripe_sofort') {
$order->update_status('completed', 'order_note');
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment