WC_Product::get_shipping_class
Returns the product shipping class SLUG.
Method of the class: WC_Product{}
No Hooks.
Returns
String.
Usage
$WC_Product = new WC_Product(); $WC_Product->get_shipping_class();
WC_Product::get_shipping_class() WC Product::get shipping class code WC 10.3.3
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 '';
}