Skip to content

Instantly share code, notes, and snippets.

@netzkollektiv
Last active January 10, 2023 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netzkollektiv/3e469816867993e549826bd735ff7d71 to your computer and use it in GitHub Desktop.
Save netzkollektiv/3e469816867993e549826bd735ff7d71 to your computer and use it in GitHub Desktop.
<?php
/*
* Plugin Name: Prevent Cancel Unpaid easyCredit Ratenkauf Orders
* Author: NETZKOLLEKTIV GmbH
* Description: Prevents unpaid orders paid with easyCredit-Ratenkauf from being cancelled
*/
// wc-easycredit-cancel-unpaid-orders.php
function wc_easycredit_cancel_unpaid_orders( $return, $order ) {
if ( 'ratenkaufbyeasycredit' === $order->get_payment_method()) {
return false;
}
return $return;
}
add_filter( 'woocommerce_cancel_unpaid_order', 'wc_easycredit_cancel_unpaid_orders', 20, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment