Skip to content
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

The add new carrier example won't obey free shipping rules #227

Open
1 task done
ioweb-gr opened this issue Jan 4, 2024 · 2 comments
Open
1 task done

The add new carrier example won't obey free shipping rules #227

ioweb-gr opened this issue Jan 4, 2024 · 2 comments

Comments

@ioweb-gr
Copy link

ioweb-gr commented Jan 4, 2024

Is there an existing issue for this?

  • I have searched the existing issues

What's missing?

In the guide for Add a custom shipping carrier https://developer.adobe.com/commerce/php/tutorials/frontend/custom-checkout/add-shipping-carrier/ it seems the example is missing critical functionality

The new carrier is added properly but it won't obey free shipping rules from cart rules because the collectTotals method is not accounting for that.

A fully working example should be given for a simple method to actually help developers build proper shipping methods.

If you could clarify this point it would help a lot.

@github-project-automation github-project-automation bot moved this to 🆕 Ready for Grooming in Commerce - Issues Jan 4, 2024
@pawan
Copy link
Contributor

pawan commented Feb 29, 2024

@ioweb-gr @jeff-matthews I have checked and shipping method is working correctly and applying Shipping discount if there are any.

@ioweb-gr If you have issue with any specific type condition, let me know.

@ioweb-gr
Copy link
Author

I had a fairly simple use case. One cart price rule which offers free shipping for the cart if it's above 60 EUR and the discount was not applying.

I then checked the code for the simple flat rate method shipped with magento and noticed that one is actually taking this into consideration separately

https://github.com/magento/magento2/blob/a98a64a73a72b7bb7bf297d3aba5f9920c8a2b70/app/code/Magento/OfflineShipping/Model/Carrier/Flatrate.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 Ready for Grooming
Development

No branches or pull requests

2 participants