WC_Shipping_Method::get_fee
Get fee to add to shipping cost.
Метод класса: WC_Shipping_Method{}
Хуков нет.
Возвращает
float.
Использование
$WC_Shipping_Method = new WC_Shipping_Method(); $WC_Shipping_Method->get_fee( $fee, $total );
- $fee(строка|float) (обязательный)
- Fee.
- $total(float) (обязательный)
- Total.
Код WC_Shipping_Method::get_fee() WC Shipping Method::get fee WC 10.4.3
public function get_fee( $fee, $total ) {
if ( strstr( $fee, '%' ) ) {
$fee = ( $total / 100 ) * str_replace( '%', '', $fee );
}
if ( ! empty( $this->minimum_fee ) && $this->minimum_fee > $fee ) {
$fee = $this->minimum_fee;
}
return $fee;
}