Add filter to control order stock reduction when payment is complete

Adds a 'woocommerce_payment_complete_reduce_order_stock' filter that
controls whether stock is reduced for an order when
WC_Order::payment_complete() is called
This commit is contained in:
Max Rice 2013-03-14 12:00:31 -04:00
parent cc08e376bc
commit eed40279ac
1 changed files with 2 additions and 1 deletions

View File

@ -1333,7 +1333,8 @@ class WC_Order {
);
wp_update_post( $this_order );
$this->reduce_order_stock(); // Payment is complete so reduce stock levels
if ( apply_filters( 'woocommerce_payment_complete_reduce_order_stock', true, $this->id ) )
$this->reduce_order_stock(); // Payment is complete so reduce stock levels
do_action( 'woocommerce_payment_complete', $this->id );
}