WordPress at Your Fingertips
function is not described

WC_Shipping_Method::get_fee() public WC 1.0

Get fee to add to shipping cost.

{} It's a method of the class: WC_Shipping_Method{}

No Hooks.

Return

float.

Usage

$WC_Shipping_Method = new WC_Shipping_Method();
$WC_Shipping_Method->get_fee( $fee, $total );
$fee(string|float) (required)
Fee.
$total(float) (required)
Total.

Code of WC_Shipping_Method::get_fee() WC 5.8.0

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;
}