Add function wc_get_is_pending_statuses
This commit is contained in:
parent
5117a65638
commit
9acc7ced5d
|
@ -116,7 +116,7 @@ class WC_Shortcode_Checkout {
|
|||
}
|
||||
|
||||
// Ensure order items are still stocked if paying for a failed order. Pending orders do not need this check because stock is held.
|
||||
if ( ! $order->has_status( 'pending' ) ) {
|
||||
if ( ! $order->has_status( wc_get_is_pending_statuses() ) ) {
|
||||
$quantities = array();
|
||||
|
||||
foreach ( $order->get_items() as $item_key => $item ) {
|
||||
|
|
|
@ -124,6 +124,16 @@ function wc_get_is_paid_statuses() {
|
|||
return apply_filters( 'woocommerce_order_is_paid_statuses', array( 'processing', 'completed' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list of statuses which are consider 'pending payment'.
|
||||
*
|
||||
* @since 3.5.4
|
||||
* @return array
|
||||
*/
|
||||
function wc_get_is_pending_statuses() {
|
||||
return apply_filters( 'woocommerce_order_is_pending_statuses', array( 'pending' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the nice name for an order status.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue