QUALITY PATCH

MDVA-39153: Discount amount is calculated incorrectly during reorder in the Admin

Discount amount is calculated incorrectly during reorder in the Admin. Quality patch MDVA-39153 for magento/module-checkout applies to Magento Open Source and Adobe Commerce 2.4.2 to 2.4.3-p3.

Categories
Shopping Cart, Admin
Components
magento/module-checkout, magento/module-sales-rule
Origin
adobe-commerce-support
Since QPT
1.1.8

Issue

Discount amount is calculated incorrectly during reorder in the Admin.

Steps to reproduce

1. Go to the Admin > Stores > Configuration > Sales > Taxes. 1. Turn on the tax for shipping displaying the tax in the Shopping Cart. 1. Enable and configure the Table rate shipping method ($15). 1. Create a tax rule for built-in tax rate (for CA). 1. Create a cart price rule with a fixed $5 discount applied to the whole cart and shipping amount. 1. Add a product with a price of $12 to the cart and go to the Shopping Cart page. 1. Apply the discount to the cart. 1. Set shipping method in "estimates" section to "Flat Rate". 1. Proceed through checkout till review steps (do not place the order). 1. Go to the homepage and then back to the Shopping Cart. 1. Change shipping method in "estimates" section to "Table Rate".

Adobe's page lists 2.4.2-p1 - 2.4.3-p1 as compatible; the versions below are resolved from the current QPT constraints and are the ones the tool will offer.

Adobe scheduled the permanent fix for 2.4.4.

Install

Install the Quality Patches Tool with composer require magento/quality-patches, apply the prerequisites listed for all files applicable to your distribution and version first, then run vendor/bin/magento-patches apply MDVA-39153. On Cloud, add MDVA-39153 under stage.build.QUALITY_PATCHES in .magento.env.yaml.

For cweagans/composer-patches, choose a compatible version below and download the bundle. Copy its MDVA-39153/ folder into patches/composer/, merge composer.patches.json into composer.json, then run composer install. Bundle prerequisites the same way and list them first. Paths are relative to each package root, using the default -p1 level. Prefer local files when configuring composer-patches; a remote URL can change.

Patch files and compatible versions

Packages across compatible versions (2): magento/module-checkout, magento/module-sales-rule
Packages across compatible versions (2): magento/module-checkout, magento/module-sales-rule

magento/magento2-base >=2.4.2 <2.4.4

Magento Open Source
2.4.3-p3, 2.4.3-p2, 2.4.3-p1, 2.4.3, 2.4.2-p2, 2.4.2-p1, 2.4.2
Adobe Commerce
2.4.3-p3, 2.4.3-p2, 2.4.3-p1, 2.4.3, 2.4.2-p2, 2.4.2-p1, 2.4.2
Patch file
patches/os/MDVA-39153_2.4.2-p1.patch
  • vendor/magento/module-checkout/Model/TotalsInformationManagement.php
  • vendor/magento/module-sales-rule/Helper/CartFixedDiscount.php

Sources

Łukasz Bajsarowicz
Built by

Łukasz Bajsarowicz, e-commerce architect

Magento and Adobe Commerce architecture, upgrades, performance and audits for merchants and agencies since 2015; magento.watch is the tooling I use on those projects.

Open source, maintained on weekends.