Automattic\WooCommerce\Internal\Utilities
COTMigrationUtil::get_order_type
Returns type pf passed id, post or order object.
Method of the class: COTMigrationUtil{}
No Hooks.
Returns
String|null. Type of the order.
Usage
$COTMigrationUtil = new COTMigrationUtil(); $COTMigrationUtil->get_order_type( $order_id );
COTMigrationUtil::get_order_type() COTMigrationUtil::get order type code WC 10.5.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 );
}