WooCommerce Tax Amount Issue

  • Status: Pending
  • Præmier: $20
  • Modtagne indlæg: 1

Konkurrence Instruktioner

I am having an issue with tax amounts and looking for help with a solution. Here is the problem:

1. Standard tax rates are setup within Woocommerce... GST at 5%.
2. My test product has a price of $100.00. When I click "add to cart", it shows subtotal of $100.00 and GST of $5.00 (5% of $100.00).
3. In reality, I have a complex and custom tax calculation ... and let's say after my calculation the GST should be $1.50.

The problem is coming from how to I pass off my GST calculation to WooCommerce and replace what it is calculating.

It seems that WC_Cart has protected arrays/objects of

[line_tax_data] => Array (
[subtotal] => Array (
[1] => 5.00
[total] => Array (
[1] => 5.00

I need a function to replace the [1]=> 5.00 with 1.50 as per my own calculation.

NOTE: This is a simple example. Please do not suggest adjusting the TAX RATES. I need to replace the TAX AMOUNTS calculated by WooCommerce.

Once I pass off my calculation to WooCommerce, then WooCommerce can continue to handle the data to store and view order information.
Thanks and looking forward to seeing your solutions!

Anbefalede Evner

Bedste indlæg fra denne konkurrence

Se flere indlæg

Offentlig Præciserings Opslagstavle

  • ezgicetin
    • 2 uger siden

    Hey there, just to give you an idea. I wouldn't go and change or add code to Woocommerce. That would require the constant updates on the piece of code to make it compatible with Woocommerce and Wordpress itself. Instead consider a Woocommerce helper plugin. There are a lot out there.

    For instance there is https://simplesalestax.com/. It's an easy plugin and although the intention is to make it easier for US, you can just customize one of the states for Canada or just create a mock state of sorts. Has support and updates. Better idea in my opinion. Best of luck!

    • 2 uger siden
  • ibiktha
    • 2 uger siden

    Hello, Please give temporary login credential to check the issue.

    • 2 uger siden

Sådan kommer du i gang med konkurrencer

  • Opret din konkurrence

    Opret din konkurrence Hurtigt og nemt

  • Få tonsvis af indlæg

    Få tonsvis af indlæg Fra hele verden

  • Tildel det bedste indlæg

    Tildel det bedste indlæg Download filerne - Nemt!

Opret en Konkurrence Nu eller slut dig til os i dag!