woocommerce_payment_complete_order_status хук-фильтрWC 1.0

Method to update an order in the database.

Использование

add_filter( 'woocommerce_payment_complete_order_status', 'wp_kama_woocommerce_payment_complete_order_status_filter', 10, 2 );

/**
 * Function for `woocommerce_payment_complete_order_status` filter-hook.
 * 
 * @param  $order    
 * @param  $order_id 
 *
 * @return 
 */
function wp_kama_woocommerce_payment_complete_order_status_filter( $order, $order_id ){

	// filter...
	return $order;
}
$order
-
$order_id
-

Где вызывается хук

WC_Order_Data_Store_CPT::update()
woocommerce_payment_complete_order_status
OrdersTableDataStore::update()
woocommerce_payment_complete_order_status
WC_Order::payment_complete()
woocommerce_payment_complete_order_status
WC_Order::maybe_set_date_paid()
woocommerce_payment_complete_order_status
WC_Order::get_date_paid()
woocommerce_payment_complete_order_status
woocommerce/includes/data-stores/class-wc-order-data-store-cpt.php 180
if ( ! $order->get_date_paid( 'edit' ) && version_compare( $order->get_version( 'edit' ), '3.0', '<' ) && $order->has_status( apply_filters( 'woocommerce_payment_complete_order_status', $order->needs_processing() ? 'processing' : 'completed', $order->get_id(), $order ) ) ) {
woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php 2037
&& $order->has_status( apply_filters( 'woocommerce_payment_complete_order_status', $order->needs_processing() ? 'processing' : 'completed', $order->get_id(), $order ) ) // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment
woocommerce/includes/class-wc-order.php 142
$this->set_status( apply_filters( 'woocommerce_payment_complete_order_status', $this->needs_processing() ? 'processing' : 'completed', $this->get_id(), $this ) );
woocommerce/includes/class-wc-order.php 315
$payment_completed_status = apply_filters( 'woocommerce_payment_complete_order_status', $this->needs_processing() ? 'processing' : 'completed', $this->get_id(), $this );
woocommerce/includes/class-wc-order.php 869
if ( 'view' === $context && ! $date_paid && version_compare( $this->get_version( 'edit' ), '3.0', '<' ) && $this->has_status( apply_filters( 'woocommerce_payment_complete_order_status', $this->needs_processing() ? 'processing' : 'completed', $this->get_id(), $this ) ) ) {

Где используется хук в WooCommerce

woocommerce/includes/gateways/cod/class-wc-gateway-cod.php 47
add_filter( 'woocommerce_payment_complete_order_status', array( $this, 'change_payment_complete_order_status' ), 10, 3 );