creating a custom tax
-
We have a maximum tax in our area of $500 with a rate of 7.5%. But I cant seem to get the filter to work right. I need to have the tax set to charge no more than 37.50 per order (7.5% of 500).
I’ve tried to using the following filter found in class-wc-tax.php but only get a return of 0:
$tax_amount = apply_filters( 'woocommerce_price_ex_tax_amount', $tax_amount, $key, $rate, $price, $the_price_inc_tax, $pre_compound_total );
and used the following code in my themes function:
add_filter('woocommerce_price_ex_tax_amount','homer_max_tax'); function homer_max_tax($tax_amount) { if($tax_amount > 37.49) {$tax_amount = 37.50; } return $tax_amount; }
I’m pretty new to php and I have been able to get the function to work an isolated test environment but can’t get it to work within WordPress
thanks for any help I can get!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘creating a custom tax’ is closed to new replies.