If we need to modify product quantity after successful order in Woo-Commerce then we can use below hook. When we don’t need to decrease product quantity which same then main product but product price is 0.

Time like this, below hook, can be used.

// define the woocommerce_reduce_order_stock callback 
function action_woocommerce_reduce_order_stock( $array ) { 
    // do your logic
// add the action 
add_action( 'woocommerce_reduce_order_stock', 'action_woocommerce_reduce_order_stock', 10, 1 );
add_action( 'woocommerce_reduce_order_stock', array( $this, 'sync_product_stocks_reduce' ) );


add_action( 'woocommerce_reduce_order_stock', function($order){
  foreach ($order->get_items() as $item_key => $item ){
    if($item->get_subtotal() == 0&& $item->get_total() == 0){
      wc_update_product_stock($item->get_product_id(), $item->get_quantity(), 'increase');	


Notify of
1 Comment
Newest Most Voted
Inline Feedbacks
View all comments
SEO Referral Program
10 months ago

Awesome post! Keep up the great work! šŸ™‚

Sign Up for Our Newsletters

Get notified of the best deals on our WordPress themes.