Automattic\WooCommerce\Internal\Fulfillments

Fulfillment::set_statuspublicWC 1.0

Set fulfillment status.

Method of the class: Fulfillment{}

No Hooks.

Returns

null. Nothing (null).

Usage

$Fulfillment = new Fulfillment();
$Fulfillment->set_status( ?string $status ): void;
?string $status(required)
.

Fulfillment::set_status() code WC 10.3.3

public function set_status( ?string $status ): void {
	$statuses = FulfillmentUtils::get_fulfillment_statuses();
	if ( ! isset( $statuses[ $status ] ) ) {
		// Change the status to an existing one if the provided status is not valid.
		$status = $this->get_is_fulfilled() ? 'fulfilled' : 'unfulfilled';
	}
	// Set the fulfillment status.
	$this->set_is_fulfilled( $statuses[ $status ]['is_fulfilled'] ?? false );
	// Set the status in the data array.
	$this->data['status'] = $status;
}