Tax applied in two different places?
-
I wanted to apply a sliding tax scale to my events, so I edited the get_price_with_tax function in classes/em-ticket.php.
function get_price_with_tax( $format = false ){ $pretaxPrice = $this->get_price_without_tax(); $adjustableTaxRate = 12; if ( $pretaxPrice >= 30 ) { $adjustableTaxRate = 11; } if ($pretaxPrice >= 40) { $adjustableTaxRate = 10; } if ($pretaxPrice >= 50) { $adjustableTaxRate = 9; } if ($pretaxPrice >= 60) { $adjustableTaxRate = 8; } // etc... $price = ceil($pretaxPrice * (1 + $adjustableTaxRate/100)); // ceil(); rounds up if( $format ) return $this->format_price($price); return $price; }
This code is working quite well and it displays the price exactly as expected on the front end. However, when you actually book an event, it charges the credit card using the tax value entered in Settings>Bookings>PricingOptions.
Is there another file or function from which the final price is passed that would be pulling this tax rate directly from the Settings value?
I am using Braintree as a payment gateway using https://gist.github.com/wturnerharris/7443520 I think it gets the amount from
'amount' => $EM_Booking->get_price(false, false, true),
What are those boolean parameters? Maybe I could tell it to get
'amount' => $EM_Booking->get_price_with_tax(),
but I don’t know what params to put in there, or if that’s even accurate at all.Anyone know where to point me?
- The topic ‘Tax applied in two different places?’ is closed to new replies.