Automattic\WooCommerce\Internal\Utilities

COTMigrationUtil::get_order_type()publicWC 1.0

Returns type pf passed id, post or order object.

Метод класса: 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() WC 7.1.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 );
}