Last active
January 10, 2023 14:59
-
-
Save netzkollektiv/3e469816867993e549826bd735ff7d71 to your computer and use it in GitHub Desktop.
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 | |
/* | |
* 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