WordPress at a glance
function is not described

WC_Product_Factory::get_product_classname() WC 3.0.0

Gets a product classname and allows filtering. Returns WC_Product_Simple if the class does not exist.

This is a method of the class: WC_Product_Factory

Hooks from the method
Return

String.

Usage

$var = WC_Product_Factory::get_product_classname( $product_id, $product_type );
$product_id(int) (required)
Product ID.
$product_type(string) (required)
Product type.

Changelog

Since 3.0.0 Introduced.

Code of WC Product Factory::get product classname: woocommerce/includes/class-wc-product-factory.php WC 3.7.0

<?php
public static function get_product_classname( $product_id, $product_type ) {
	$classname = apply_filters( 'woocommerce_product_class', self::get_classname_from_product_type( $product_type ), $product_type, 'variation' === $product_type ? 'product_variation' : 'product', $product_id );

	if ( ! $classname || ! class_exists( $classname ) ) {
		$classname = 'WC_Product_Simple';
	}

	return $classname;
}