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:
parent
cc08e376bc
commit
eed40279ac
|
@ -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 );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue