Advertisement
bowenac

Untitled

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