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.8.7.0

apply_filters('woocommerce_valid_order_statuses_for_payment') is found 2 times:

  • /includes/class-wc-order.php line 425
    					do_action( 'woocommerce_order_status_changed', $this->get_id(), $status_transition['from'], $status_transition['to'], $this );
    
    					// Work out if this was for a payment, and trigger a payment_status hook instead.
    					if (
    						in_array( $status_transition['from'], apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', '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 1724
    	 *
    	 * @return bool
    	 */
    	public function needs_payment() {
    		$valid_order_statuses = apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', '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: