woocommerce_payment_complete

woocommerce_payment_complete

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: woocommerce.9.7.1

do_action('woocommerce_payment_complete') is found 1 times:

  • /includes/class-wc-order.php line 172
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
             */
            $this->set_status( apply_filters( 'woocommerce_payment_complete_order_status', $this->needs_processing() ? OrderStatus::PROCESSING : OrderStatus::COMPLETED, $this->get_id(), $this ) );
            $this->save();
     
            do_action( 'woocommerce_payment_complete', $this->get_id(), $transaction_id );
        } else {
            do_action( 'woocommerce_payment_complete_order_status_' . $this->get_status(), $this->get_id(), $transaction_id );
        }
    } catch ( Exception $e ) {
        /**
         * If there was an error completing the payment, log to a file and add an order note so the admin can take action.

See this hook used in plugins: