WordPress at Your Fingertips
function is not described

WC_Template_Loader::get_template_loader_default_file() private WC 3.0.0

Get the default filename for a template except if a block template with the same name exists.

{} It's a method of the class: WC_Template_Loader{}

No Hooks.

Return

String.

Usage

$result = WC_Template_Loader::get_template_loader_default_file();

Changelog

Since 3.0.0 Introduced.
Since 5.5.0 If a block template with the same name exists, return an empty string.

Code of WC_Template_Loader::get_template_loader_default_file() WC 5.6.0

private static function get_template_loader_default_file() {
	if (
		is_singular( 'product' ) &&
		! self::has_block_template( 'single-product' )
	) {
		$default_file = 'single-product.php';
	} elseif ( is_product_taxonomy() ) {
		$object = get_queried_object();

		if ( is_tax( 'product_cat' ) || is_tax( 'product_tag' ) ) {
			if ( self::has_block_template( 'taxonomy-' . $object->taxonomy ) ) {
				$default_file = '';
			} else {
				$default_file = 'taxonomy-' . $object->taxonomy . '.php';
			}
		} elseif ( ! self::has_block_template( 'archive-product' ) ) {
			$default_file = 'archive-product.php';
		}
	} elseif (
		( is_post_type_archive( 'product' ) || is_page( wc_get_page_id( 'shop' ) ) ) &&
		! self::has_block_template( 'archive-product' )
	) {
		$default_file = self::$theme_support ? 'archive-product.php' : '';
	} else {
		$default_file = '';
	}
	return $default_file;
}