• Resolved Matti

    (@masahrpro)


    I am trying to: Give clients outside EU the view of prices excl. tax, and clients within EU incl. tax

    I expected to see: If a client is registered, or has set the address on checkout that is outside EU the prices should show without VAT. This works as intended.

    Instead, I got: It also makes everyone else to see prices on VARIABLE PRODUCTS without VAT regardless if they are from EU or not.

    After extensive testing and troubleshooting it turns out woocommerce make use of transients to fetch the price information and thus displaying the prices on the variable products incorrectly store-wide after a visitor from OUTSIDE EU adds their delivery address to the checkout page. Single products works ok as far as we have been testing this issue.

    I have setup a clean WP/WC (Storefront theme) staging to confirm this bug is not theme related, and I am able to reproduce this issue there.

    Temporary correction of product prices: Edit a variable product, save it (without making any changes). This restores the correct prices incl.tax untill next visitor from outside EU comes to play.

    Steps on how to reproduce the error:

    1. Browse the site in incognito mode to view the correct product prices. All the products are set to display 10€ (incl. tax)

    2. Add the variable product hoodie-with-logo-copy/ to the cart and head to checkout page.

    3. You can use this address for delivery and activate the 0% tax that has been configured for clients from Norway:
    Street: Storgatan 5
    ZIP: 4010
    City: Stavanger
    Country: Norway

    4. Complete checkout and return to main page. Verify all the simple product prices are now displayed without VAT and the variable product incorrectly with VAT.

    5. Close the incognito window, and open a new incognito window.

    6. You will notice that all the single product prices are OK (with vat), and the Variable item ‘Hoodie with OPTIONS’ is showing the price without VAT. This is the bug.

    Important step on testing is also to close the incognito window after one test, and open a whole new incognito window to verify results. Simply opening a new tab on incognito mode does not always work.

    Regarding geolocation – MaxMind is active & license added (just like on the live environment) The display of taxes however has been set to assign the taxes on checkout page based on the client shipping address.

    For testing the view with VAT you can use this address:

    Street: H?meentie 11
    Zip: 00530
    City: Helsinki
    Country: Finland

    One further clarification to avoid any misunderstandings:

    How the prices should be displayed:
    Norway = VAT 0% (Not a EU member state)
    Finland = VAT 24%
    Sweden = VAT 24%

    But also please note: The main issue is displaying prices without VAT for new customers entering the site (before adding an address), once there has been customers browsing the site eligible to view prices without VAT… Default should always be to display prices with VAT.

    Initially I thought this might be an issue with WPML, and the support thread with their support can be seen here: https://wpml.org/forums/topic/tax-is-displayed-incorrect-on-variable-product-prices-on-multilingual-site/

    According to their conclusions the issue however lies in WooCommerce itself.

    the problematic transient is _transient_wc_var_prices_740
    This transient is stored based on the user session, so it could be that something from woocommerce_sessions table or a custom config is causing this behaviour.

    The sandbox site is a clean install with only WP+WC installed without any customisations made.

    • This topic was modified 3 years, 7 months ago by Matti.

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

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘VAT is displayed incorrect on variable products.’ is closed to new replies.