Created
May 14, 2025 05:54
-
-
Save mehrshaddarzi/ece0482efe0095aaa067248b888a9917 to your computer and use it in GitHub Desktop.
Disable Coupon Usage for Pending Order
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
<?php | |
// https://github.com/woocommerce/woocommerce/issues/27673 | |
add_action('plugins_loaded', function(){ | |
remove_action( 'woocommerce_order_status_pending', 'wc_update_coupon_usage_counts'); | |
}); | |
//add_filter( 'woocommerce_hold_stock_for_checkout', function() { return false; } ); | |
function woo_set_coupon_hold_minutes( $mins ) { | |
$mins = 0; | |
return $mins; | |
}; | |
add_filter( 'woocommerce_coupon_hold_minutes', 'woo_set_coupon_hold_minutes', 50, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment