WordPress at Your Fingertips
function is not described

WC_Product::get_shipping_class() public WC 1.0

Returns the product shipping class SLUG.

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

No Hooks.

Return

String.

Usage

$WC_Product = new WC_Product();
$WC_Product->get_shipping_class();

Code of WC_Product::get_shipping_class() WC 5.8.0

public function get_shipping_class() {
	$class_id = $this->get_shipping_class_id();
	if ( $class_id ) {
		$term = get_term_by( 'id', $class_id, 'product_shipping_class' );

		if ( $term && ! is_wp_error( $term ) ) {
			return $term->slug;
		}
	}
	return '';
}