-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Subtotal (Excl. Tax)" condition for Cart rule is not working for FREE Shipping #36760
Comments
Hi @MagePsycho. Thank you for your report.
Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
For more details, review the Magento Contributor Assistant documentation. Add a comment to assign the issue: To learn more about issue processing workflow, refer to the Code Contributions.
🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket. ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
Hi @engcom-Bravo. Thank you for working on this issue.
|
@magento give me 2.4-develop instance |
Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you. |
Hi @engcom-Bravo, here is your Magento Instance: https://8feab656eb27ff671c9d6c7dec786a2d.instances.magento-community.engineering |
Hi @MagePsycho, Thank you for reporting and collaboration. Steps to reproduce 1.Create a cart rule with following We are giving as a condition subtotal should be equals or greater than 100.we added a product into cart greater 100 so in that case free shipping is applying. Kindly let us know if we missed anything. Thanks. |
Please apply the coupon and check if still the FREE shipping is getting applied? |
@magento give me 2.4-develop instance |
Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you. |
Hi @engcom-Bravo, here is your Magento Instance: https://8feab656eb27ff671c9d6c7dec786a2d.instances.magento-community.engineering |
Hi @MagePsycho, Thanks for your update. Verified the issue on Magento 2.4-develop instance and the issue is not reproducible.Kindly refer the screenshots. Steps to reproduce 1.Create a cart rule with following As per first cart price subtotal is greater than 100 hence in that case we are getting free shipping. We are not able to apply coupon(2 cart price rule) .Please let us know if you are facing issue to apply coupon. Thanks. |
Please make sure the coupon code (discount) is applied (create a cart rule with such coupon code first). |
@magento give me 2.4-develop instance |
Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you. |
Hi @engcom-Bravo, here is your Magento Instance: https://8feab656eb27ff671c9d6c7dec786a2d.instances.magento-community.engineering |
Hi @MagePsycho, Thanks for your update. We have created 2 cart price rules.1 for condition and 1 for coupon code. We are not able to apply coupon code for a product please let us know you are facing issue to apply coupon. Thanks. |
Please make the coupon work (Maybe you need to make |
Hi @MagePsycho, Thanks for your update. Verified the issue on Magento 2.4-develop instance and the issue is reproducible.Kindly refer the screenshots. Created a cart rule with following Conditions: Subtotal (Excl. Tax) is equals or greater than 100 Created another cart rule with coupon XYZ to give a Fixed amount discount for whole cart of 10 Storefront 1.Add items to the cart to make a subtotal of 105 As per 1 cart price rule we added a product with a price of 105, hence we are getting free shipping. Here we are applying coupon code with a discount of 10 hence the subtotal is reduced to 95 so in that case free shipping should not be applied as per 1 cart price rule. Free shipping should be applied when subtotal is 105. Hence confirming the issue. Thanks. |
@magento I am working on this |
Hi @engcom-Bravo , @MagePsycho , In Adobe Magento, we can add multiple cart rules at a time without coupon code So, Here the scenario is Rule 1 :- Without COUPON Rule 2 :- With COUPON, Apply discount for the whole cart amount is 10%. In Cart, Scenario 1:- let assume as 105
Scenario 2:- let assume as 90
Scenario 1 is expected , Please let me know if i was understanding in different way. |
The issue I am raising is: So if you configure the FREE shipping cart rule with But Magento is still giving FREE shipping (but it shouldn't). Note that |
Hello, As I can see this issue got fixed in the scope of the internal Jira ticket AC-7886 by the internal team Based on the Jira ticket, the target version is 2.4.7-beta1. Thanks |
Preconditions and environment
2.4.3-p2
Steps to reproduce
Backend
Subtotal (Excl. Tax)
is equals or greater than100
Free Shipping
=For matching items only
XYZ
to give aFixed amount discount for whole cart
of10
Storefront
XYZ
to get 10$ OFFExpected result
The shipping fee should not be 0 (i.e. FREE shipping cart rule should not be applied)
Actual result
The shipping fee is showing 0 (i.e. FREE shipping cart rule is applied)
Additional information
!https://user-images.githubusercontent.com/1205071/213676297-f3145d58-e179-47fb-aebc-19d5edb4e47a.png|width=593,height=348!
Quick n Dirty Solution
Step debugging showed that the value provided by the
$address->getData('base*subtotal_with*discount')
is not correct:!https://user-images.githubusercontent.com/1205071/213677260-afb0ac81-6fd1-450a-a945-3212f479f63c.png|width=509,height=152!
So ended up tweaking as below:
\Magento\OfflineShipping\Model\SalesRule\Calculator::processFreeShipping()
``{{
public function processFreeShipping(\Magento\Quote\Model\Quote\Item\AbstractItem $item)
{
$address = $item->getAddress();
$item->setFreeShipping(false);
foreach ($this->_getRules($address) as $rule) {
/* Quick Fix - Start /
$address->setBaseSubtotalWithDiscount($address->getBaseSubtotal() + $address->getBaseDiscountAmount());
/ Quick Fix - End */
/* @var $rule \Magento\SalesRule\Model\Rule */
if (!$this->validatorUtility->canProcessRule($rule, $address))
{ continue; }
}}``
Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: