Created
July 24, 2024 11:48
-
-
Save webtoffee-git/79a2a870a46fa979cf1aaa6627b8cf04 to your computer and use it in GitHub Desktop.
Code to skip the order with status Pending payment from generating sequential order number - By WebToffee (Sequential order number for WooCommerce)
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 //Do not copy this line of code | |
add_filter('wt_sequential_is_draft_order', 'wt_sequential_skip_pending_order',10,2); | |
function wt_sequential_skip_pending_order($is_draft_order, $order){ | |
if(!$is_draft_order && ('pending'=== $order->get_status())){ | |
$is_draft_order = true; | |
} | |
return $is_draft_order; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment