The MDVA-30837 patch adds configuration options for the free shipping calculation so the user can configure the Minimum Order Amount to get Free Shipping based on the Subtotal (or Grand Total). This allows local customizations for tax and shipping methods. This patch is available when the Magento Quality Patch (MQP) tool v.1.0.7 is installed. Please note that the issue is scheduled to be fixed in Magento version 2.4.2.
Affected products and versions
- The patch was designed for Magento Commerce Cloud 2.3.4-p2.
- The patch is also compatible with the following Magento versions: Magento Commerce Cloud 2.3.1 to 2.3.4-p2.
Note: The patch can be applicable to other versions. To check if the patch is compatible with your Magento version, run ./vendor/bin/magento-patches status
.
Issue
The patch MDVA-30837 adds the configuration setting to configure the Minimum Order Amount setting to get free shipping based on the Subtotal (or Grand Total):
- Include Tax to Amount Yes/No in the Free Shipping method configuration.
- When Include Tax to Amount is set to Yes the minimum order amount is calculated as Subtotal + Tax - Discount.
- When Include Tax to Amount is set to No the minimum order amount is calculated as Subtotal - Discount.
Steps to reproduce
- Go to Stores > Settings > Configuration > Sales > Tax and set the following:
- Tax Calculation Based on Shipping Address
- Enable Cross Border Trade: No
- Display Produce Prices in Catalog: Excluding Tax
- Display Shipping Prices: Excluding Tax
- Display Prices: Excluding Tax
- Display Subtotal: Excluding Tax
- Display Shipping Amount: Excluding Tax
- Display Gift Wrapping Prices: Excluding Tax
- Display Printed Card Prices: Excluding Tax
- Include Tax in Order Total: Yes
- Display Full Tax Summary: Yes
- Go to Sales > Shipping Settings > Free Shipping and set Minimum Order Amount = 30.
- Go to Marketing > Promotions > Cart Price Rules and create a new price rule (for detailed steps refer to Magento User Guide Create a Cart Price Rule).
- Coupon Code = Specific Coupon.
- Conditions: Subtotal equals or greater than $25.
- Actions: Free Shipping = For shipments with matching items.
- Create a product with the price $23.10.
- Add the CA tax to the default tax rule.
- Add this product to the cart.
- Get a shipping quote - after taxes, the Grand Total = 25.01 and free shipping is applied.
- Apply the coupon code - it will not be valid because the Subtotal (Excluding Tax) is $23.10.
Expected result:
There is an additional configuration setting - Include Tax to Amount: Yes/No in Free Shipping method configuration:
- When Include Tax to Amount is set to Yes Minimum Order Amount is calculated as Subtotal + Tax - Discount.
- When Include Tax to Amount is set to No Minimum Order Amount is calculated as Subtotal - Discount.
Actual result:
The Free Shipping price rule condition can only be based on the Subtotal, while the Free Shipping method can only be based on the Grand Total.
Apply the patch
For instructions on how to apply an MQP patch, use the following links depending on your Magento product:
- Magento Commerce: DevDocs Software Update Guide > Apply patches.
- Magento Commerce Cloud: DevDocs Upgrades and Patches > Apply Patches.
Related reading
To learn more about Magento Quality Patches, refer to:
For info about other patches available in MQP tool, refer to the Patches available in MQP tool section.