• Resolved charliemcf

    (@charliemcf)


    I have some products which require a more complex tax calculation than a simple %age figure and I’m really struggling to find a solution. My thought was to add a custom tax rate of an arbitrary %age and set that as the tax rate for the ‘complex’ products. Then when added to the cart, filter the product on its tax rate, and if it’s the custom rate then carry out the ‘complex’ tax calculation and replace the original tax amount with the updated value. The updated tax amount would need to appear on the cart, checkout, order etc.

    All advice would be very welcome, thanks. Any solution that works is fine, I don’t have to use the approach outlined above. Code snippets would be great, I’m by no means an expert coder but have used hooks and filters etc.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Daniyal Ahmed (a11n)

    (@daniyalahmedk)

    Hi there,

    Thanks for reaching out.

    I am trying to understand your requirements, do you want to show a fixed tax amount for “complex” products? And use % tax calculation on normal products?

    Let me know, and I’ll be glad to help further.

    Best,

    Thread Starter charliemcf

    (@charliemcf)

    Thanks! I want to use a % tax amount on normal products – so I can just use the usual Woocommerce process for these, that’s fine. But the “complex” products have a price which includes a taxable and a non-taxable component (long story, and I wish it wasn’t the case but it is – so I just have to deal with it!). So I have to identify these products, then deduct the non-taxable component, apply a % tax to the remaining (taxable) component, and use that tax amount for that product.

    For example: A Normal product: Price excluding tax = $100, tax amount (at 10%) = $10, price including tax = $110.
    A Complex product: Price excluding tax = $100 (non taxable component = $40, taxable component = $60), tax amount (at 10% of taxable component) = $6, price including tax = $106.
    So a shopping cart/checkout containing one of each of these products would have a subtotal of $200 (Ex Tax), a tax of $16, and a total of $116.

    Hope this makes sense!

    Thread Starter charliemcf

    (@charliemcf)

    Sorry – last line should read a total of $216!

    Hello,

    Using additional tax class could work for this scenario.

    1) Create a tax class – https://snipboard.io/9b0WvF.jpg
    2) add a rate – https://snipboard.io/qDpaQj.jpg
    3) apply that tax class to the complex product – https://snipboard.io/FLig4O.jpg

    When you add both standard product and complex product to the cart with this settings, below is the result:

    Link to image: https://snipboard.io/s2ETjf.jpg

    You can read more about additional tax classes here:
    https://woocommerce.com/document/setting-up-taxes-in-woocommerce/#additional-tax-classes

    I hope it helps!

    Thread Starter charliemcf

    (@charliemcf)

    Thanks for taking the time to work through this! My problem is that the taxed/non-taxed components don’t always stay at the same ratio for every complex product, so I would have to set up a custom tax rate for every complex product. So 50 complex products would be 50 custom rates!

    If I add another complex product to the previous example:

    Complex product 2: Price excluding tax = $200 (non taxable component = $40, taxable component = $160), tax amount (at 10% of taxable component) = $16, price including tax = $216. This would be an overall tax rate of 8%, so the custom rate of 6% for the previous complex product wouldn’t work here.

    Mirko P.

    (@rainfallnixfig)

    Hi @charliemcf,

    It sounds like WooCommerce alone by default won’t handle the way you want to apply taxes as it’s based on percentage tax rates. You may want to look at tax extensions in the marketplace and see if you can find the one that works for you.

    https://woocommerce.com/search/?q=tax&collections=product&page=1

    Our policy offers a full refund within 30 days of your date of purchase. You can try the extensions and get a refund within the refund period if the products don’t work the way you need.

    Alternatively, you can consult with a developer who can help you create a custom solution. We recommend checking out our customizations page.

    Best regards.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How can I carry out tax calculations which aren’t just a %age?’ is closed to new replies.