Magento2: Display Tax for Grouped Product

Created on 20 Jan 2017  Â·  11Comments  Â·  Source: magento/magento2

Grouped product don't has adjustements (VAT) on both category & product pages

Preconditions

  1. Magento version 2.1.3
  2. Php 5.6
  3. Maria DB 5.7.9

Steps to reproduce

  1. Create simple product with taxable goods (tax rate to 20 for example)
  2. Create grouped product and associate simple one to it
  3. Configure tax in order to display both prices (exclude & include taxe)

Expected result

  1. Grouped and simple prices are the same on frontend
  2. Grouped product page
    Starting at
    120,00 €
    Excl. tax 100,00 €
  • Simple product page
    120,00 €
    Excl. tax 100,00 €

Actual result

  • Grouped product page
    Starting at
    100,00 €
    Excl. tax 100,00 €

  • Simple product page
    120,00 €
    Excl. tax 100,00 €

Note :
It work fine on Magento 2.0.6

Tax Format is valid bug report

Most helpful comment

I have created a very small extension which fixes this specific issue for grouped products. You can install it to fix this issue until it is fixed in Magento core. Thanx to @maderlock for the actual solution.

https://github.com/jghaanstra/magento-grouped-product-tax-fix

All 11 comments

Any news concerning this issue, it's still present in Magento 2.1.5. For me this is a pretty nasty bug. By law I'm obligated to show prices including tax in my country. Due to this bug I'm not able to and I'm violating the law.

I have the same issue, my store is exclusively grouped products so it's taken me an absolute age just to realise it was a problem with grouped products alone.

Any work arounds?

By the way, this is a duplicate of https://github.com/magento/magento2/issues/6729

Is it a duplicate? That seems to be for configurable products, where as this is grouped products. Do they share enough of the same code for the issue to be the same?

Tracing the code, it looks like the associated products collection does not include the tax_class_id, so when it gets to the tax calculation it does not have enough information. My workaround is a preference for Magento\GroupedProduct\Model\Product\Type\Grouped, rewriting the function getAssociatedProducts so that the addAttributeToSelect call has all the following entries: 'name', 'price', 'special_price', 'special_from_date', 'special_to_date', 'tax_class_id'

The default Magento implementation misses off tax_class_id.

Yes, I came to a similar conclusion after your remark about the grouped versus configurable product. Or at least that associated products collection was the culprit. Have not looked into a workaround but yours sounds good. Do you have it online somewhere?

No, sorry. I locally have a module with about 10 Magento bug fixes while I wait for them to appear in a release.

I have created a very small extension which fixes this specific issue for grouped products. You can install it to fix this issue until it is fixed in Magento core. Thanx to @maderlock for the actual solution.

https://github.com/jghaanstra/magento-grouped-product-tax-fix

Thanks @jghaanstra and @maderlock. I've just tested this fix on my instance and it appears to work great.

@youness, thank you for your report.
The issue is already fixed in develop branch, 2.2.0

Will this ever be applied to Magento 2.1.* branch?

Was this page helpful?
0 / 5 - 0 ratings