Advertisement
bowenac

Untitled

Apr 3rd, 2013
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.             foreach ( $rates as $key => $rate ) {
  2.             $ny = $price-17500;
  3.             if ($state == 'NY')
  4.                 $tax_amount = ( $ny * $rate['rate'] / 100 );
  5.             else
  6.                 $tax_amount = ($price * $rate['rate'] / 100 );
  7.  
  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.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement