in germany there is a special Tax on coffee: 2.19 EUR per 1000 gram, and 4.78 EUR per 1000 gram for instant coffee.

I'd like to solve this problem by adding a custom tax to magento. How would I do that?


I need to calculate the additional product tax based on the product weight instead of the product price.

The product weight may change depending on which (or if any) product options are selected. This is a customer requirement and cannot be changed.

3 Answers 3


You could modify the existing tax model, but it seems like you are trying to / may have a requirement to display this tax separately. Based on the requirement to display this as part of the totals display, you need to create a custom totals model. Classy Llama have a great series on this rather involved process..

As a summary, you'll need to do the legwork to register your collector and, if you like, use a separate calculation model or just bake yours into your collector. You can grab the products from the address and perform the calculation you need.


please go through with the magento knowledge base for this.


  • The problem is that (AFAIK) magento can only work with fixed or percental taxes based on the product price. I need to calculate the taxes based on the product weight. Jan 8, 2014 at 11:56
  • @keks : you have to create tax on shipping for this. have a look on the link magentocommerce.com/knowledge-base/entry/…
    – urfusion
    Jan 8, 2014 at 12:01
  • Thanks for your help, but this does not meet my customers requirements. My customer does not want increased shipping costs to german customers, he wants to display the extra-tax enforced on him by german tax rules. Jan 8, 2014 at 12:15
  • I thought about writing a module to do this, but I don't know which classes/methods i need to override, yet. Any hints? Taxes are calculated in several places like product overview, product details, cart, checkout, ... Jan 8, 2014 at 12:17
  • look at this magentocommerce.com/boards/viewthread/1735 here you find a batter answer for which file you have to override.
    – urfusion
    Jan 8, 2014 at 12:31

A little late to party here but you can setup a Shopping Cart Sales Rule based on weight, you will have to first go to the attributes and change the promotions rule restriction on the weight attribute to yes

enter image description here

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.