Search code examples
phpwordpresswoocommercewordpress-theming

Display price suffix on WooCommerce emails


I'm looking for a way to display a price suffix in the WooCommerce emails. Like: ex.VAT Is there a short snippet to do this? enter image description here


Solution

  • Copy the file found at

    wp-content/plugins/woocommerce/templates/emails/email-order-items.php -> wp-content/themes/your-theme/woocommerce/emails/email-order-items.php
    

    into your store’s child theme .

    Note that if you customize the parent theme rather than the child theme, any changes will be overwritten with theme updates.

    Change code in wp-content/themes/your-theme/woocommerce/emails/email-order-items.php

    Before

    <td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>; vertical-align:middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;">
                <?php echo wp_kses_post( $order->get_formatted_line_subtotal( $item ) ); ?>
    </td>
    

    After

    <td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>; vertical-align:middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;">
                <?php echo wp_kses_post( $order->get_formatted_line_subtotal( $item ) ); ?> ex. VAT
    </td>