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