• Resolved Ishtiyaq Husain

    (@ishtiyaqhu)


    I want to remove the default selected state from the checkout form. So, I used this hook and working fine:

    add_filter( 'default_checkout_billing_state', 'change_default_checkout_state' );
    add_filter( 'default_checkout_shipping_state', 'change_default_checkout_state' );
    
    function change_default_checkout_state() {        
        return ''; // state code
    }

    But, when I use this the calculation on checkout page subtotal is not equal to cart page subtotal. When we select the state on the checkout page then calculation on the checkout page is correct.

    Example:
    Cart Page Subtotal: Rs. 200.00 [OK]
    Checkout Page Subtotal (no state selected): Rs. 185.12 [NOT OK]
    Checkout Page Subtotal (with state selected): Rs. 200.00 [OK]

    What I am trying to do?
    No state should be selected by default but calculation on car and checkout page should be the same.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support EtienneP a11n

    (@etiennep)

    Hi there!

    What I believe is happening is that on the cart page, you have entered an address with a state, so the subtotal there shows the price including tax for that state.

    Them when you go to checkout, since you don’t have a state selected already, it shows the subtotal without tax, but when you do select that state, it shows the correct subtotal including tax.

    What you can do to work around that is to set it so that the prices in the cart and check out shows excluding tax under WooCommerce > Settings > Tax > Tax Options;

    woocommerce tax
    Link to image: https://cld.wthms.co/YPJrdG

    Plugin Support EtienneP a11n

    (@etiennep)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Cart and Checkout Subtotal Mismatch’ is closed to new replies.