add_action('woocommerce_email_before_order_table', 'apply_custom_tax_suffix_in_woocommerce_emails', 10, 4); function apply_custom_tax_suffix_in_woocommerce_emails($order, $sent_to_admin, $plain_text, $email) { // Only apply this filter during the WooCommerce email generation add_filter('woocommerce_get_formatted_order_item_price', 'add_tax_percentage_to_order_item_price_in_email', 10, 2); } function add_tax_percentage_to_order_item_price_in_email($formatted_price, $item) { // Get the product object from the order item $product = $item->get_product(); // Ensure the product exists and the prices include tax if ($product && wc_prices_include_tax()) { // Get tax rates for the product's tax class $tax_rates = WC_Tax::get_rates($product->get_tax_class()); if (!empty($tax_rates)) { // Get the first tax rate (assuming only one applies) $tax_rate = reset($tax_rates); $tax_percentage = $tax_rate['rate']; // Get the tax percentage from WooCommerce settings // Find the tax amount within the formatted price and append the tax percentage $formatted_price = preg_replace_callback( '/(\d+[\.,]?\d*) € Tax/', function($matches) use ($tax_percentage) { return $matches[1] . ' € ' . $tax_percentage . '% Tax'; }, $formatted_price ); } } return $formatted_price; }

Revolutionary search

Performers

Filters

Work

Filters

Artists

Filters