Currently, the discount module doesn't handle/support VAT.
However, there are existing solutions in order to support that (See #2276227: [META] Use order discount with VAT).

Lately, a fix was committed to make sure discount line items weren't recreated on each cart refresh (See #2905616: Discount line items are always recreated on each cart refresh.).

As a consequence, we're currently only removing discount price components, so if there's any other price component present on the discount line items such as VAT that needs to be removed, it won't be by default.

There's currently a way to do this using the alter hook called inside commerce_discount_remove_discount_components()
via the hook_commerce_discount_remove_price_component_alter(), but there's no context about the line item that's being manipulated, you can basically get the component, but there's no way to know the VAT component belongs to the discount line item so you'd risk removing VAT on non discount line items.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jsacksick created an issue. See original summary.

jsacksick’s picture

Attached my proposal to fix this.

jsacksick’s picture

Title: Make sure all the price components are removed on discount lien items » Make sure all the price components are removed on discount line items
jsacksick’s picture

Status: Needs review » Fixed
Issue tags: +Needs tests

This needs tests, but since I need that for a project pretty quickly, I'll commit that as it is, and write a test in a follow-up issue.

  • jsacksick committed d48a451 on 7.x-1.x
    Issue #2920056 by jsacksick: Make sure all the price components are...
jsacksick’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.