WC_Product::get_shipping_class() – Returns the product shipping class SLUG.

You appear to be a bot. Output may be restricted

Description

Returns the product shipping class SLUG.

Usage

$string = WC_Product::get_shipping_class();

Parameters

Returns

string

Source

File name: woocommerce/includes/abstracts/abstract-wc-product.php
Lines:

1 to 11 of 11
  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 '';
  }
 

 View on GitHub View on Trac