Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Created July 24, 2024 11:48
Show Gist options
  • Save webtoffee-git/79a2a870a46fa979cf1aaa6627b8cf04 to your computer and use it in GitHub Desktop.
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)
<?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