woocommerce_payment_complete_order_status
woocommerce_payment_complete_order_status
Appears in: woocommerce.3.4.2, woocommerce.3.4.4, woocommerce.3.4.5, woocommerce.3.4.6, woocommerce.3.4.7, woocommerce.3.5.0, woocommerce.3.5.1, woocommerce.3.5.2, woocommerce.3.5.3, woocommerce.3.5.4, woocommerce.3.5.5, woocommerce.3.5.6, woocommerce.3.5.7, woocommerce.3.5.8, woocommerce.3.6.1, woocommerce.3.6.2, woocommerce.3.6.3, woocommerce.3.6.4, woocommerce.3.6.5, woocommerce.3.7.0, woocommerce.3.7.1, woocommerce.3.8.0, woocommerce.3.8.1, woocommerce.3.9.0, woocommerce.3.9.1, woocommerce.3.9.2, woocommerce.3.9.3, woocommerce.4.0.0, woocommerce.4.0.1, woocommerce.4.1.0, woocommerce.4.1.1, woocommerce.4.2.0, woocommerce.4.2.1, woocommerce.4.3.0, woocommerce.4.3.1, woocommerce.4.3.2, woocommerce.4.3.3, woocommerce.4.4.0, woocommerce.4.4.1, woocommerce.4.5.1, woocommerce.4.5.2, woocommerce.4.6.0, woocommerce.4.6.1, woocommerce.4.6.2, woocommerce.4.7.0, woocommerce.4.7.1, woocommerce.4.8.0, woocommerce.4.9.0, woocommerce.4.9.1, woocommerce.4.9.2, woocommerce.5.0.0, woocommerce.5.1.0, woocommerce.5.2.0, woocommerce.5.2.1, woocommerce.5.2.2, woocommerce.5.3.0, woocommerce.5.4.0, woocommerce.5.4.1, woocommerce.5.5.0, woocommerce.5.5.1, woocommerce.5.5.2, woocommerce.5.6.0, woocommerce.5.6.1, woocommerce.5.7.0, woocommerce.5.7.1, woocommerce.5.8.0, woocommerce.6.3.1, woocommerce.6.4.1, woocommerce.6.5.1, woocommerce.6.6.1, woocommerce.6.7.0, woocommerce.6.8.0, woocommerce.6.8.1, woocommerce.6.8.2, woocommerce.6.9.0, woocommerce.6.9.4, woocommerce.7.0.0, woocommerce.7.1.0, woocommerce.7.1.1, woocommerce.7.2.2, woocommerce.7.3.0, woocommerce.7.4.0, woocommerce.7.4.1, woocommerce.7.5.1, woocommerce.7.6.0, woocommerce.7.6.1, woocommerce.7.7.0, woocommerce.7.7.1, woocommerce.7.8.1, woocommerce.7.9.0, woocommerce.8.0.2, woocommerce.8.0.3, woocommerce.8.1.1, woocommerce.8.2.1, woocommerce.8.2.2, woocommerce.8.3.1, woocommerce.8.4.0, woocommerce.8.5.1, woocommerce.8.5.2, woocommerce.8.6.0, woocommerce.8.6.1, woocommerce.8.7.0, woocommerce.8.8.3, woocommerce.8.9.2, woocommerce.8.9.3, woocommerce.9.0.2, woocommerce.9.1.2, woocommerce.9.1.4, woocommerce.9.2.2, woocommerce.9.2.3, woocommerce.9.3.1, woocommerce.9.3.3, woocommerce.9.4.2, woocommerce.9.4.3, woocommerce.9.5.1
Hook Type: filter
See hook in action
Displaying hooks found in version: woocommerce.9.5.1apply_filters('woocommerce_payment_complete_order_status') is found 5 times:
- /includes/class-wc-order.php line 168
* @param int $order_id Order ID. * @param WC_Order $this Order object. * @since 2.7.0 */ $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 ); }
- /includes/class-wc-order.php line 349
* @param int $order_id Order ID. * @param WC_Order $this Order object. * @since 2.7.0 */ $payment_completed_status = apply_filters( 'woocommerce_payment_complete_order_status', $this->needs_processing() ? OrderStatus::PROCESSING : OrderStatus::COMPLETED, $this->get_id(), $this ); if ( $this->has_status( $payment_completed_status ) ) { // If payment complete status is reached, set paid now. $this->set_date_paid( time() ); } elseif ( OrderStatus::PROCESSING === $payment_completed_status && $this->has_status( OrderStatus::COMPLETED ) ) {
- /includes/class-wc-order.php line 944
* @param int $order_id Order ID. * @param WC_Order $this Order object. * @since 3.0.0 */ && $this->has_status( apply_filters( 'woocommerce_payment_complete_order_status', $this->needs_processing() ? OrderStatus::PROCESSING : OrderStatus::COMPLETED, $this->get_id(), $this ) ) ) { // In view context, return a date if missing. $date_paid = $this->get_date_created( 'edit' ); } return $date_paid; }
- /includes/data-stores/class-wc-order-data-store-cpt.php line 188
* @param WC_Order $order Order object. */ public function update( &$order ) { // Before updating, ensure date paid is set if missing. 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 ) ) ) { $order->set_date_paid( $order->get_date_created( 'edit' ) ); } // Also grab the current status so we can compare. $previous_status = get_post_status( $order->get_id() ); // If the order doesn't exist in the DB, we will consider it as new.
- /src/Internal/DataStores/Orders/OrdersTableDataStore.php line 2671
// Before updating, ensure date paid is set if missing. 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 ) ) // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment ) { $order->set_date_paid( $order->get_date_created( 'edit' ) ); } if ( null === $order->get_date_created( 'edit' ) ) { $order->set_date_created( time() );