Automattic\WooCommerce\Internal\Utilities

COTMigrationUtil::get_order_type()publicWC 1.0

Returns type pf passed id, post or order object.

Method of the class: COTMigrationUtil{}

No Hooks.

Return

String|null. Type of the order.

Usage

$COTMigrationUtil = new COTMigrationUtil();
$COTMigrationUtil->get_order_type( $order_id );
$order_id(int|WP_Post|WC_Order) (required)
Order ID, post object or order object.

COTMigrationUtil::get_order_type() code WC 8.7.0

public function get_order_type( $order_id ) {
	$order_id         = $this->get_post_or_order_id( $order_id );
	$order_data_store = \WC_Data_Store::load( 'order' );
	return $order_data_store->get_order_type( $order_id );
}