• Hello there,

    It’s actually a simple question, tl;dr version: How can I get the cart total before tax?

    ***
    I modified a copy of cart-totals.php inside my template to show totals (after shipping, coupons, etc.) like the following,

    Vat
    Totals

    The code itself:

    <tr class=”tax-total”>
    <th><?php echo esc_html( WC()->countries->tax_or_vat() ); ?></th>
    <td><?php echo wc_cart_totals_taxes_total_html(); ?></td>
    </tr>

    <tr class=”order-total”>
    <th><?php _e( ‘Total’, ‘woocommerce’ ); ?></th>
    <td><?php wc_cart_totals_order_total_html(); ?></td>
    </tr>

    I’d like to add an extra row before the tax, preciselly to show the total excluding taxes, and I’d like to know how to get that. I have set in Woocommerce options to show cart totals after taxes, but seems to be either everything after taxes or everything before taxes.

    I need:

    Total Before Tax
    Tax
    End Total

    Thank you very much

    Best Regards,

    Luis M. Lorca
    l3hworks.com

    https://www.ads-software.com/plugins/woocommerce/

  • The topic ‘Get Total BEFORE Taxes’ is closed to new replies.