WC_Product_Variation::get_shipping_class_id()
Get shipping class ID.
Method of the class: WC_Product_Variation{}
Hooks from the method
Return
Int
.
Usage
$WC_Product_Variation = new WC_Product_Variation(); $WC_Product_Variation->get_shipping_class_id( $context );
- $context(string)
- What the value is for. Valid values are view and edit.
Default: 'view'
Changelog
Since 3.0.0 | Introduced. |
WC_Product_Variation::get_shipping_class_id() WC Product Variation::get shipping class id code WC 9.3.3
public function get_shipping_class_id( $context = 'view' ) { $shipping_class_id = $this->get_prop( 'shipping_class_id', $context ); if ( 'view' === $context && ! $shipping_class_id ) { $shipping_class_id = apply_filters( $this->get_hook_prefix() . 'shipping_class_id', $this->parent_data['shipping_class_id'], $this ); } return $shipping_class_id; }