SHOW:
|
|
- or go back to the newest paste.
1 | foreach ( $rates as $key => $rate ) { | |
2 | - | if ($rate['compound'] == 'yes') |
2 | + | $ny = $price-17500; |
3 | - | continue; |
3 | + | if ($state == 'NY') |
4 | - | if ($state == 'NY' && $price > 17500) |
4 | + | $tax_amount = ( $ny * $rate['rate'] / 100 ); |
5 | - | $ny = $price-17500; |
5 | + | else |
6 | - | $tax_amount = ( $ny * $rate['rate'] / 100 ); |
6 | + | $tax_amount = ($price * $rate['rate'] / 100 ); |
7 | ||
8 | - | $tax_amount = ($price * $rate['rate'] / 100 ); |
8 | + | // ADVANCED: Allow third parties to modify this rate |
9 | $tax_amount = apply_filters( 'woocommerce_price_ex_tax_amount', $tax_amount, $key, $rate, $price); | |
10 | ||
11 | // Back to pounds | |
12 | $tax_amount = ( $tax_amount / 100 ); | |
13 | ||
14 | // Rounding | |
15 | if ( get_option( 'woocommerce_tax_round_at_subtotal' ) == 'no' && ! $suppress_rounding ) { | |
16 | $tax_amount = $this->round( $tax_amount ); | |
17 | } | |
18 | ||
19 | // Add rate | |
20 | if ( ! isset( $taxes[ $key ] ) ) | |
21 | $taxes[ $key ] = $tax_amount; | |
22 | else | |
23 | $taxes[ $key ] += $tax_amount; | |
24 | } |