woocommerce_valid_order_statuses_for_payment

woocommerce_valid_order_statuses_for_payment

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

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

apply_filters('woocommerce_valid_order_statuses_for_payment') is found 2 times:

  • /includes/class-wc-order.php line 459
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
         * @param array    $valid_order_statuses Array of valid order statuses for payment.
         * @param WC_Order $order                Order object.
         * @since 4.0.0
         */
        in_array( $status_transition['from'], apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( OrderStatus::PENDING, OrderStatus::FAILED ), $this ), true )
        && in_array( $status_transition['to'], wc_get_is_paid_statuses(), true )
    ) {
        /**
         * Fires when the order progresses from a pending payment status to a paid one.
         *
         * @since 3.9.0
  • /includes/class-wc-order.php line 1788
    1784
    1785
    1786
    1787
    1788
    1789
    1790
    1791
    1792
    1793
    1794
         * @param array    $valid_order_statuses Array of valid order statuses for payment.
         * @param WC_Order $order                Order object.
         * @since 2.7.0
         */
        $valid_order_statuses = apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( OrderStatus::PENDING, OrderStatus::FAILED ), $this );
        return apply_filters( 'woocommerce_order_needs_payment', ( $this->has_status( $valid_order_statuses ) && $this->get_total() > 0 ), $this, $valid_order_statuses );
    }
     
    /**
     * See if the order needs processing before it can be completed.
     *

See this hook used in plugins: