-
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
Magento 2.4.5 - Free shipping not applied with cart price rule #35967
Comments
Hi @pixel-paul. 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-Delta. Thank you for working on this issue.
|
Hi @pixel-paul , Followed steps:
Thanks |
Hi @engcom-Delta, Thanks for looking into this. Am I missing something here, but in your example the shipping is not discounted? Thanks, Paul |
Hi @pixel-paul , I have cross checked i could see free shipping got applied. |
@engcom-Delta I am encountering the same issue described above with free shipping applied by cart price rule. |
Here is a quick fix for this bug applied to magento/module-quote reverting some code from the following commit bd14944. index 64725d8..aef9fb0 100644
--- a/Model/Quote/Address/Total/Shipping.php
+++ b/Model/Quote/Address/Total/Shipping.php
@@ -73,7 +73,7 @@ class Shipping extends \Magento\Quote\Model\Quote\Address\Total\AbstractTotal
$address->setFreeMethodWeight($data['freeMethodWeight']);
$isFreeShipping = $this->freeShipping->isFreeShipping($quote, $shippingAssignment->getItems());
- $address->setFreeShipping((int)$isFreeShipping);
+ $address->setFreeShipping($isFreeShipping);
// recalculate weights
$data = $this->getAssignmentWeightData($address, $shippingAssignment->getItems());
$address->setItemQty($data['addressQty']);
diff --git a/Test/Unit/Model/Quote/Address/Total/ShippingTest.php b/Test/Unit/Model/Quote/Address/Total/ShippingTest.php
index 495a19c..54c2ac5 100644
--- a/Test/Unit/Model/Quote/Address/Total/ShippingTest.php
+++ b/Test/Unit/Model/Quote/Address/Total/ShippingTest.php
@@ -218,7 +218,7 @@ class ShippingTest extends TestCase
$this->address
->expects($this->once())
->method('setFreeShipping')
- ->with((int)$isFreeShipping);
+ ->with($isFreeShipping);
$this->total->expects($this->atLeastOnce())
->method('setTotalAmount');
$this->total->expects($this->atLeastOnce())``` |
Hi @engcom-Delta - you have provided two different methods to add free shipping. The method I am using, as confirmed by @danhort is this method: https://docs.magento.com/user-guide/marketing/price-rules-cart-free-shipping.html It looks like you have used this method in your first example. Please retest and confirm this as it looks very much like a bug. |
That is great, thank you @danhort - I can confirm that this corrects the issue. @engcom-Delta - can you retest please using the cart price rule method of providing free shipping? This appears to be a bug. |
Hi @pixel-paul , Here is the videos for reference.
Regards, |
Hi @engcom-Delta - my guess is that the issue is with upgrade from 2.4.4 to 2.4.5 - might be worth checking that the value for |
Hi @pixel-paul We have tried to reproduce this issue in magento 2.4.5 ,2.4-develop and upgrade Magento 2.4.4 to 2.4.5 but the issue is not reproducible . Steps are followed to reproduce the issue 1.Upgrade magento 2.4.4 to magento 2.4.5 3.Create a cart price rule for free shipping 4.Proceed to checkout and checked the free shipping applied Here, the free shipping is applied
Please let us know if we are missing any steps here. |
Hi @pixel-paul , We have noticed that, this issue has not been updated for a period of 14 Days.Hence we assume that this issue is fixed now, so we are closing it. Please raise a fresh ticket or reopen this ticket if you need more assistance on this. Thanks. |
We got a similar problem. The same setings like above. We had not used the free shipping method. We used shopping cart rules only to reduce the shipping cost of table rates too "free"/0€. Before the update the table rates shipping methods showed corretcly"0€" for shipping (when conditions are met). After the update the free shipping in combination with shipping cart rules does not work anymore. It shows wrong table rates values. Instead of 0€ or the correct value it showed values of a lower table rate level. settings: Conditions of shopping cart rules Additional info regarding table rates which are used "DEU" is for Germany => please use Germany for testing in checkout setting of table rates => weight vs destination Results before the update -> we did not use shipping method "free shipping". We had it not activated and it was working like descriebed above. Results after the update -> (wrong) the "table rate" shipping shows now wrong shipping rate (lowest) if the conditions are met. This makes no sense from our point of view? It somehow reduced the weight in the cart to meet the lower rule? if rule is not active => correct table rates are shown based on weight in cart if the rule is triggered / conditons are met => wrong table rates are shown Nothing has changed in the cart. Before the update it showed "0.00" because of free shipping Now it shows a wrong table rate. Correct would be this line DEU,,,1.0000,5.9500 => 5,95 € Correct would be from our point of view (like it was before the update) |
@engcom-Delta Please reopen this issue. Forcing people to select a different shipping method is not acceptable. The customer should still be able to pick the delivery method they want (ex: Parcel Depot, Weekend Delivery, etc.) |
Hello @nocturnalfrog @MartinKonVis, Thanks for your comment! We are reopening this issue for further process. Thanks |
Adding a +1 as changing this cast by removing (int) has fixed the free shopping cart rule that broke after the 2.4.5-p1 (from 2.3.5) upgrade. |
Hi @engcom-Dash. Thank you for working on this issue.
|
@magento give me 2.4-develop instance |
Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you. |
Hi @engcom-Dash, here is your Magento Instance: https://bcd405ca9297e8da50a815235ff7b7cb.instances.magento-community.engineering |
@magento give me 2.4-develop instance |
Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you. |
Hi @engcom-Dash, here is your Magento Instance: https://bcd405ca9297e8da50a815235ff7b7cb.instances.magento-community.engineering |
Hi @pixel-paul , Thanks for your information and collaboration, We are verified the issue again in 2.4-develop branch as well as 2.4.5-p1 instance and the issue is not reproducible.We are getting the free shipping method. Preconditions: Steps to reproduce: 1.Upgrade magento 2.4.4 to magento 2.4.5 2.Enabled free shipping Thanks. |
@engcom-Dash What if we always offered Free Shipping for slow delivery and used "Flat Rate" for next day delivery?
|
Hi @pixel-paul , We are closing this issue as there has been no latest update on the same. Kindly reopen / create new issue if you are still facing any issues. |
Hi, We are having the same issue with discounts. We cannot use "Free shipping" method because we have more complex options to decide if the shipping is free or not. Force to use the "Free shipping" method is not a solution for our case. |
Can we use this code change? We are struggling with this issue after we upgraded to 2.3.5-p2 |
We had the same issue after upgrading to 2.4.5-p2 the free shipping stopped working. After some debugging I found out that the issue was in one of our 3 party extension handling shipments. They are expecting type boolean. Because of this change it breaks backward compatibility for 3 party extensions, that expected it is a boolean type |
Thank you guys for these informations. I made a simple module to apply @vipinroy commit in a preference, if you need. Cheers |
I've updated to M246-p5 and I've had to apply this patch by @danhort to get the free shipping to work. I have table rates enabled and click & collect, I do not use a third party checkout.....very coincidental if this is not a bug in my opinion. |
@magento give me 2.4-develop instance |
Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you. |
Hi @engcom-Dash, here is your Magento Instance: https://bcd405ca9297e8da50a815235ff7b7cb.instances-prod.magento-community.engineering |
Hi @pixel-paul Thanks for reporting and collaboration. Verified the issue on magento 2.4 dev instance and the issue is not reproducable. Steps to reproduce: We can see the free shipping applied with cart price rule. Please take a look at the screenshots I've attached. Let us know if we missed anything. ![]() |
Preconditions and environment
This was working in 2.4.4
Steps to reproduce
Create a cart price rule for free shipping:
Expected result
Order should have shipping set to £0
Actual result
Order does not have shipping set to £0.00:
Additional information
No response
Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: