TycheSoftwares / checkout-fees-for-woocommerce

Payment Gateway Based Fees & Discounts - Lite
1 stars 0 forks source link

Fee tax class based on cart items #127

Open Chetna1510 opened 1 year ago

Chetna1510 commented 1 year ago

Describe the bug WooCommerce by default supports shipping tax class based on cart items. Which means if there are only product with 5% Tax the shipping is going to have 5% tax too. If there is even one product with 27% tax the shipping is going to have 27% tax. https://snipboard.io/8fIC9n.jpg

In your plugin this logic cannot be set, only a fix tax class can be selected.

To Reproduce Steps to reproduce the behavior:

  1. I have 2 types of Taxes. Standard - 19% Reduced Rate - 7%

  2. WooCommerce applies Taxes to products - image

  3. For first product, I've set Standard Tax class with 5% fees - image

  4. For 2nd product, I've 10% fees added with Reduced tax class - image

  5. But on checkout page, it includes only standard rates

image

I enabled taxes for adding it in fees and it's now shows

image

For 5% fees(i.e 5 fees value), the tax should be 0.95( 19 Tax % 5 ) For 10% fees(i.e 10 fees value), the tax should be 0.7( 7 Tax % 10 )

Expected behavior Tax should be calculated correctly based on shipping tax class.

Additional context https://wordpress.org/support/topic/fee-tax-class-based-on-cart-items/

Chetna1510 commented 1 year ago

Another client has reported this - https://tychesoftwares.freshdesk.com/a/tickets/52600

ust want to inform you that we noticed that your plugin seems to change the tax class to "standard" of all products instead of keeping it to the different tax classes we have assigned to them (6 % for books, 12 % for food and 25 % other things).

Chetna1510 commented 1 year ago

Again sharing steps:

  1. Set Standard Tax: 10%
  2. Set Reduced Tax: 5%

Product A - price: 80,000 Product B - Price: 1000

Product A has below setup:

Standard Tax assigned Payment Gateway fee - 20 fixed Payment gateway: Enabled Standard Tax

Product B has below Setup: Reduced Tax assigned Payment Gateway fee - 30 fixed Payment gateway: Enabled Reduced Tax

Result is: image

Enable "Merge all fees" setting on "General" page:

image

See the difference on total..

mital-tyche commented 1 year ago

Hello @Chetna1510, In this above scenario, everything is working fine as per Woocommerce Tax calculation.

For Example.

For Product One

  1. Price Tax Tax is 10% of price = 8000 Standard Tax.
  2. Fees Tax ( Fees is Fix 20 ) So, 10% of fees = 2 Standard Tax

For Product Two 1.Price Tax Tax is 5% of price = 50 Reduce Tax.

  1. Fees Tax ( Fees is Fix 30 ) So, 5% of fees = 1.5 Reduce Tax.

Total Reduce = 1.5 + 50 = 51.5 Total Standard = 8000 + 2 = 8002

Total Fees= 30 + 20 (Fees) After merge the fees. Fees becoming as a one fees. It's not working longer as separate fees. So either fees is merge with the product1 or product2. So which ever product is added first in cart the fees gonna merge into this product. So, In above case fees merge in product2. so fees is working as product2 fees & calculate tax based on this. For now. Product 1 fees = after merge there is no fees for product 1 = 8000 Standard Tax on price Product 2 fees = 5% of Fees ( It's applied reduce tax on fees in product2)
= 2.5 Reduce Tax on fees + 50 Reduce Tax on price

Total Reduce = 2.5 + 50 = 52.5 Total Standard = 8000 = 8000

Let me know your thought about the same @Chetna1510 & @kartikparmar. Also can you please check about the same @pinalj & @rashmimalpande.