WC_Shipping_Method::get_fee( string|float $fee, float $total )

Get fee to add to shipping cost.


Description Description


Parameters Parameters

$fee

(Required) Fee.

$total

(Required) Total.


Top ↑

Return Return

(float)


Top ↑

Source Source

File: includes/abstracts/abstract-wc-shipping-method.php

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

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.