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.
Return Return
(float)
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; }