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) { // Add a filter that modifies the price suffix for emails only add_filter('woocommerce_get_formatted_order_item_price', 'add_tax_percentage_to_order_item_price', 10, 2); } function add_tax_percentage_to_order_item_price($formatted_price, $item) { // Get the product object from the order item $product = $item->get_product(); // Check if taxes are included in the prices if (wc_prices_include_tax() && $product) { // 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 settings // Extract the current tax amount from the formatted price if (preg_match('/(\d+[\.,]?\d*)/', $formatted_price, $matches)) { $tax_amount = $matches[0]; // Append the tax percentage to the price string $formatted_price = sprintf(__('includes %1$s € %2$s%% Tax', 'woocommerce'), $tax_amount, $tax_percentage); } } } return $formatted_price; }

Revolutionary search

Performers

Filters

Work

Filters

Artists

Filters