id = $id; $this->label = $label; $this->cost = $cost; $this->taxes = ! empty( $taxes ) && is_array( $taxes ) ? $taxes : array(); $this->method_id = $method_id; } /** * get_shipping_tax function. * * @return array */ public function get_shipping_tax() { return apply_filters( 'woocommerce_get_shipping_tax', sizeof( $this->taxes ) > 0 && ! WC()->customer->is_vat_exempt() ? array_sum( $this->taxes ) : 0, $this ); } /** * Get label. * * @return string */ public function get_label() { return apply_filters( 'woocommerce_shipping_rate_label', $this->label ); } /** * Add some meta data for this rate. * @since 2.6.0 * @param string $key * @param string $value */ public function add_meta_data( $key, $value ) { $this->meta_data[ wc_clean( $key ) ] = wc_clean( $value ); } /** * Get all meta data for this rate. * @since 2.6.0 * @param string $key * @param string $value */ public function get_meta_data() { return $this->meta_data; } }