Automattic\WooCommerce\StoreApi\Schemas\V1\Agentic

CheckoutSessionSchema::get_selected_fulfillment_option_idprotectedWC 1.0

Get selected fulfillment option ID.

Method of the class: CheckoutSessionSchema{}

No Hooks.

Returns

String|null. Selected option ID or null.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_selected_fulfillment_option_id();

CheckoutSessionSchema::get_selected_fulfillment_option_id() code WC 10.7.0

protected function get_selected_fulfillment_option_id() {
	$chosen_methods = WC()->session->get( SessionKey::CHOSEN_SHIPPING_METHODS );

	return ! empty( $chosen_methods[0] ) ? $chosen_methods[0] : null;
}