• Resolved deanMKD

    (@deanmkd)


    I have one little isusue that dont know how to resolve myself. I have set in my shop to show separated Price and shipping costs but in total showed me bad price.

    For example my products cost 24.99€ + SHIPPING FEE : 3,95€ = 28.94€ but in calculation in cart page is calculating: 24.99€ + 3.95€ – 0.26€ what is wrong.

    https://i.stack.imgur.com/tsUdj.png

    i found that Total price is calculated via this function from cart-totals.php:

    <td data-title="<?php esc_attr_e( 'Total', 'woocommerce' ); ?>"><?php wc_cart_totals_order_total_html(); ?></td>

    I have one little isusue that dont know how to resolve myself. I have set in my shop to show separated Price and shipping costs but in total showed me bad price.

    For example my products cost 24.99€ + SHIPPING FEE : 3,95€ = 28.94€ but in calculation in cart page is calculating: 24.99€ + 3.95€ – 0.26€ what is wrong.

    and bellow is function from wc-cart-functions.php

    function wc_cart_totals_order_total_html() {
    $value = '<strong>' . WC()->cart->get_total() . '</strong> ';
    
    // If prices are tax inclusive, show taxes here.
    if ( wc_tax_enabled() && WC()->cart->display_prices_including_tax() ) {
        $tax_string_array = array();
        $cart_tax_totals  = WC()->cart->get_tax_totals();
    
        if ( get_option( 'woocommerce_tax_total_display' ) == 'itemized' ) {
            foreach ( $cart_tax_totals as $code => $tax ) {
                $tax_string_array[] = sprintf( '%s %s', $tax->formatted_amount, $tax->label );
            }
        } elseif ( ! empty( $cart_tax_totals ) ) {
            $tax_string_array[] = sprintf( '%s %s', wc_price( WC()->cart->get_taxes_total( true, true ) ), WC()->countries->tax_or_vat() );
        }
    
        if ( ! empty( $tax_string_array ) ) {
            $taxable_address = WC()->customer->get_taxable_address();
            $estimated_text  = WC()->customer->is_customer_outside_base() && ! WC()->customer->has_calculated_shipping()
                ? sprintf( ' ' . __( 'estimated for %s', 'woocommerce' ), WC()->countries->estimated_for_prefix( $taxable_address[0] ) . WC()->countries->countries[ $taxable_address[0] ] )
                : '';
            $value .= '<small class="includes_tax">' . sprintf( __( '(includes %s)', 'woocommerce' ), implode( ', ', $tax_string_array ) . $estimated_text ) . '</small>';
        }
    }
    
    echo apply_filters( 'woocommerce_cart_totals_order_total_html', $value );
    }

    So my question is how to add that 0.26E at Total Price, so will get correct price. Is this some bug ? I using Woocommerece 3.3.4. Thanks

    • This topic was modified 6 years, 8 months ago by deanMKD.
    • This topic was modified 6 years, 8 months ago by deanMKD.
    • This topic was modified 6 years, 8 months ago by deanMKD.
    • This topic was modified 6 years, 8 months ago by deanMKD.
    • This topic was modified 6 years, 8 months ago by deanMKD.
    • This topic was modified 6 years, 8 months ago by deanMKD.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hi @deanmkd,

    As a first step, can you check to see if this happens even with every plugin disabled except WooCommerce and with a default theme like Twenty Seventeen?

    If the problem is still there, can you share your System Status report here and let us know what your tax settings look like?

    Thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘How to show Product Price + Shipping VAT in “Total” Merged’ is closed to new replies.