skip to Main Content

WordPress Code Snippets


Display Taxes in the WooCommerce Cart

This snippet allows you to display a breakdown of taxes in the cart, improving customer understanding of charges.

add_filter('woocommerce_cart_totals_before_order_total', 'display_cart_taxes');
function display_cart_taxes() {
    $taxes = WC()->cart->get_taxes_total();
    echo '<tr class="tax-rate">
        <th>' . __('Taxes', 'woocommerce') . '</th>
        <td>' . wc_price($taxes) . '</td>
    </tr>';
}

I’m a WordPress developer with 10+ years of experience in WooCommerce and custom plugins. I combine technical expertise with design flair to help you create standout, user-friendly websites. Let’s transform your digital presence!

Best WordPress Hosting
Back To Top
Search