Skip to content

magento/magento2#32468: Fix cart-fixed discount missing shipping VAT - #41078

Open
swnsma wants to merge 1 commit into
magento:2.4-developfrom
swnsma:magento/magento2#32468
Open

magento/magento2#32468: Fix cart-fixed discount missing shipping VAT#41078
swnsma wants to merge 1 commit into
magento:2.4-developfrom
swnsma:magento/magento2#32468

Conversation

@swnsma

@swnsma swnsma commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Fixed Issues

  1. Fixes Cart Price Rules not applying on shipping VAT when rule applied on whole cart #32468 — Cart price rules not applying on shipping VAT when rule applied on whole cart

Manual testing scenarios

  1. Configure tax: shipping tax class taxable, catalog/shipping/apply discount on prices Including Tax, cross-border trade Yes, flat rate per order ($5).
  2. Create cart price rule: fixed amount for whole cart 56, apply to shipping Yes, coupon.
  3. Add product priced 51 (incl tax class), apply coupon and set flat rate shipping.
  4. Expected: discount −56, shipping discount 5.00 (not 4.17 excl), grand total 0.
  5. Verify coupon-before-shipping and shipping-before-coupon both recollect correctly.
  6. Multi-shipping cart-fixed paths are intentionally unchanged (existing multishipping cart-fixed tests remain the regression lock).

Questions or comments

Single-shipping cart-fixed now seeds remaining balance after item allocation and caps shipping discount using the tax discount basis (ShippingAmountForDiscount when set). Multi-shipping keeps the previous dual-gate detection and proportional formula to minimize regression surface.

Includes unit tests and integration suite CartFixedShippingTaxTest for the ticket matrix, partial remaining, discount-never-exceeds-rule, and related tax configs.

@m2-assistant

m2-assistant Bot commented Aug 2, 2026

Copy link
Copy Markdown

Hi @swnsma. Thank you for your contribution!
Here are some useful tips on how you can test your changes using Magento test environment.
❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here
ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

Apply remaining cart-fixed balance to shipping using the tax discount
basis (including tax when configured). Multi-shipping cart-fixed
detection and proportional totals are intentionally unchanged to
minimize regression risk.

Adds unit and integration coverage for the reported incl-tax path,
coupon/shipping order, discount-never-exceeds-rule, and related tax
configurations.
@swnsma
swnsma force-pushed the magento/magento2#32468 branch from 53cbd95 to cc409c6 Compare August 2, 2026 14:34
@swnsma

swnsma commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@magento run all tests

@swnsma

swnsma commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@magento run Functional Tests B2B,Functional Tests CE,Functional Tests EE,
WebAPI Tests

@engcom-Hotel engcom-Hotel added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Aug 4, 2026
@github-project-automation github-project-automation Bot moved this to Pending Review in Pull Requests Dashboard Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: pending review

Projects

Status: Pending Review

Development

Successfully merging this pull request may close these issues.

Cart Price Rules not applying on shipping VAT when rule applied on whole cart

2 participants