cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove Tax on Delivery Cost - OOTB applies tax on delivery cost

0 Kudos
726

Hi Experts,

Could you please guide me, how I can remove the tax on delivery cost.

OOTB Scenario:

  1. Add product to the cart (product has gross pricing - price 1000$ which includes tax 100$)

  2. Verifty subtotal = total = 1000$

  3. Navigate to checkout page, select delivery address, Select delivery mode (standard delivery 50 $ gross price)

  4. Verify subtotal = 1000$, delivery charge = 50$, total = 1050$

  5. Below the order total, you can see 'Your order contains 105$ tax'


Technically what is happening, (Service: DefaultCalculationService, Method: getTaxCorrectionFactor)

  1. Check if total & subtotal are same ? (1050 != 1000)

  2. If not, loadfactor = total / subtotal. (loadfactor = 1.05)

  3. The taxvalue is multiplied by this loadfactor (tax = 100 * 1.05 = 105)


Is there a way, I can get rid of tax being applied on delivery cost ?

Overriding the standard method is the last option I am thinking to take. As this is pretty much practical scenario where we don't want to charge tax on delivery cost, has anyone faced this ? What's the resolution ?

-Regards, Nitin

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Nitin,

I assume you are using B2C accelerator. i.e. it shows all prices and costs as Gross. Because this is meant to show the customer the final price/cost he has to pay including any applicable taxes. Since the product prices and delivery costs are configured as 'Gross', it displays them as total prices which includes taxes, taxes are calculated accordingly and shown.

I am not sure how you want to handle tax calculations on delivery costs in your usecase. Are you going to display only net cost for delivery?

I assume you will handle that somehow.

During the checkout, the displayed delivery modes are provided by

 deliveryService.getSupportedDeliveryModeListForOrder(..)

which returns only the delivery modes that are applicable for the country AND 'gross' (because the Order is 'Gross'). So if you configure the ZoneDeliveryMode as 'Net', then it will not be shown.

Even after you extend this to show all delivery modes, the CalculationService will reset all additional costs during calculation. If the price/cost is net, then taxes will be applied on top,if Gross, the taxes are adjusted on the price/cost.

I am afraid, it is not possible to change this behavior with any simple configuration. You may have to extend the DefaultCalculationService (possible resetAdditionalCosts() method)

Best

Shanmugaraja

0 Kudos

Thank you very much and really appreciate the answer in detail!

Before the delivery mode is selected, product: 1000$ subtotal:1000$ total:1000$ "order contains 100$ tax" Now after the delivery mode is selected, delivery cost of 50$ is applied. This is gross price, including tax. WHY there is a need to adjust the tax ? If the tax needs to be adjusted, why only considering tax on product ? If the product is exempted from tax, or it has zero tax, there would not be any tax on delivery cost. Can I maintain tax on delivery cost OOTB? or it will always consider the tax applied on product?

0 Kudos

When you say the product price is 100 (net), then the final cost of the Product is 100+taxes and taxes will be calculated based on the tax rate(which is based on delivery zones).

When you say the product price is 100(gross), this is final price for the customer including all taxes. i.e. net price of the Product is ~90.90 (assuming 10% tax rate). i.e. it is just showing how much is the tax amount out of the total price(100).

Even delivery cost incur taxes, so similar logic is applied here as well.

If a Product is tax-free, then you need to set the correct taxgrou/rate to that Product.

0 Kudos

Whether or not a Product is taxable, has no impact the delivery charges, delivery a service which there will be taxes.

0 Kudos

Is there any configuration where I can define the tax that should be applied on delivery charge ?

0 Kudos

No, it isn't possible. What you can do is, -extend deliveryService.getSupportedDeliveryModeListForOrder(..) and return net delivery modes too - extend the DefaultCalculationService.

Answers (2)

Answers (2)

0 Kudos

Instead, you can use the normal taxe modes(Gross),do not extend DeliveryService. Just extend the DefaultCalculationService as below:

From:

 protected void calculateTotals(final AbstractOrderModel order, final boolean recalculate,
             final Map<TaxValue, Map<Set<TaxValue>, Double>> taxValueMap) throws CalculationException
     {
         if (recalculate || orderRequiresCalculationStrategy.requiresCalculation(order))
         {
 ..
 ..
             // taxes
             final double totalTaxes = calculateTotalTaxValues(//
                     order, recalculate, //
                     digits, //
                     getTaxCorrectionFactor(taxValueMap, subtotal, total, order), //
                     taxValueMap);//


To:

 protected void calculateTotals(final AbstractOrderModel order, final boolean recalculate,
             final Map<TaxValue, Map<Set<TaxValue>, Double>> taxValueMap) throws CalculationException
     {
         if (recalculate || orderRequiresCalculationStrategy.requiresCalculation(order))
         {
 ..
 ..
             // taxes
             final double totalTaxes = calculateTotalTaxValues(//
                     order, recalculate, //
                     digits, //
                     getTaxCorrectionFactor(taxValueMap, subtotal, total - order.getDeliveryCost().doubleValue(), order), //
                     taxValueMap);//

This will make sure the tax correction factor will NOT consider the delivery costs

0 Kudos

Perfect! I was thinking in the same direction, bit differently.

How about overriding getTaxCorrectionFactor & default the factor to 1.

Do you think there would be any implications ?

0 Kudos

getTaxCorrectionFactor() is a private method and overriding this would also apply the factor 1 everywhere. I would rather control only for deliverycosts as thats what I need now

Former Member
0 Kudos

On the ZoneDeliveryMode you can configure whether your pricing is net or gross, it's OOTB functionality

0 Kudos

Setting the pricing to net, I couldn't see any delivery mode in shipment step during checkout.

Besides, as per the calculation in commerce OOTB, the tax on the product is adjusted. Rather than tax on product price, tax is applied on product price + delivery cost.