Merge branch 'pr/22409'
This commit is contained in:
commit
afbdd06e83
|
@ -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.6.0
|
||||
* @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.
|
||||
*
|
||||
|
@ -304,7 +314,6 @@ function wc_register_order_type( $type, $args = array() ) {
|
|||
/**
|
||||
* Return the count of processing orders.
|
||||
*
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
function wc_processing_order_count() {
|
||||
|
@ -917,13 +926,15 @@ function wc_get_order_note( $data ) {
|
|||
}
|
||||
|
||||
return (object) apply_filters(
|
||||
'woocommerce_get_order_note', array(
|
||||
'woocommerce_get_order_note',
|
||||
array(
|
||||
'id' => (int) $data->comment_ID,
|
||||
'date_created' => wc_string_to_datetime( $data->comment_date ),
|
||||
'content' => $data->comment_content,
|
||||
'customer_note' => (bool) get_comment_meta( $data->comment_ID, 'is_customer_note', true ),
|
||||
'added_by' => __( 'WooCommerce', 'woocommerce' ) === $data->comment_author ? 'system' : $data->comment_author,
|
||||
), $data
|
||||
),
|
||||
$data
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue