includes/shipping/flat-rate/class-wc-shipping-flat-rate.php 1 location
|
@@ 100-117 (lines=18) @@
|
| 97 |
|
* @param array $atts |
| 98 |
|
* @return string |
| 99 |
|
*/ |
| 100 |
|
public function fee( $atts ) { |
| 101 |
|
$atts = shortcode_atts( array( |
| 102 |
|
'percent' => '', |
| 103 |
|
'min_fee' => '' |
| 104 |
|
), $atts ); |
| 105 |
|
|
| 106 |
|
$calculated_fee = 0; |
| 107 |
|
|
| 108 |
|
if ( $atts['percent'] ) { |
| 109 |
|
$calculated_fee = $this->fee_cost * ( floatval( $atts['percent'] ) / 100 ); |
| 110 |
|
} |
| 111 |
|
|
| 112 |
|
if ( $atts['min_fee'] && $calculated_fee < $atts['min_fee'] ) { |
| 113 |
|
$calculated_fee = $atts['min_fee']; |
| 114 |
|
} |
| 115 |
|
|
| 116 |
|
return $calculated_fee; |
| 117 |
|
} |
| 118 |
|
|
| 119 |
|
/** |
| 120 |
|
* calculate_shipping function. |
includes/shipping/legacy-flat-rate/class-wc-shipping-legacy-flat-rate.php 1 location
|
@@ 129-146 (lines=18) @@
|
| 126 |
|
* @param array $atts |
| 127 |
|
* @return string |
| 128 |
|
*/ |
| 129 |
|
public function fee( $atts ) { |
| 130 |
|
$atts = shortcode_atts( array( |
| 131 |
|
'percent' => '', |
| 132 |
|
'min_fee' => '' |
| 133 |
|
), $atts ); |
| 134 |
|
|
| 135 |
|
$calculated_fee = 0; |
| 136 |
|
|
| 137 |
|
if ( $atts['percent'] ) { |
| 138 |
|
$calculated_fee = $this->fee_cost * ( floatval( $atts['percent'] ) / 100 ); |
| 139 |
|
} |
| 140 |
|
|
| 141 |
|
if ( $atts['min_fee'] && $calculated_fee < $atts['min_fee'] ) { |
| 142 |
|
$calculated_fee = $atts['min_fee']; |
| 143 |
|
} |
| 144 |
|
|
| 145 |
|
return $calculated_fee; |
| 146 |
|
} |
| 147 |
|
|
| 148 |
|
/** |
| 149 |
|
* calculate_shipping function. |