I want to create a custom tax rate percentage calculation for bundle products.

I have a standard rate of 20% tax set up to be applied to all products that have taxable goods tax class set on them. I have a bundle product that has 2 simple products associated with it. 1 has a tax class of 'Taxable Goods', the other has a tax class of 'None'. The bundle product has a fixed price and SKU.

When this product is added to the basket the tax rate applied to the product should be 10%. This is because 50% of the products being purchased are taxable, therefore only 50% of initial tax rate (20%) applies. See my example below of how I would like this to work.

C * ( B / A ) = Tax rate to be applied to the bundle product

20 * ( 1 / 2 ) = 10

  • A = Total number of products in the configured bundle.
  • B = Total number of taxable products in the configured bundle.
  • C = Tax Rate (20%)

Does anyone know where in the core code I could plugin to implement such a feature?

  • Any luck? I have this problem too.
    – paul
    Sep 15, 2019 at 14:05
  • 1
    Hi Paul - I managed to get this to work by preferencing the Magento\Tax\Model\Calculation\TotalBaseCalculator class and applying updates to the calculateWithTaxInPrice function. It's not a great solution so reluctant to apply it in here as an answer. Hope that helps. Sep 16, 2019 at 15:38
  • Thanks @Ryan Copeland I also had a solution to this thats not as slick but I just made a ad-hoc tax class and added a calculator to the admin to do the calculation and apply the ad-hoc tax rate.
    – paul
    Sep 17, 2019 at 17:40


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.