-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
EVENT_BEFORE_FETCH_RATES not triggering #141
Comments
This would be more down to how Commerce handles registered shipping methods. We register our shipping methods via I wouldn't have thought a rate-fetch is done when marking an order as completed, because rates have already been fetched at that point (where you would select the shipping method during checkout). In fact, you wouldn't want rates to be changing at any other time, as they'd make for an unexpected experience (the rate could change). There might need to be some other mechanism for your logic, if it depends on not only when a cart is saved, but when it's made into an order too? The |
We are using |
Using that event to modify what's sent to FedEx is totally fine. It was my understanding of Commerce that nothing is recalculated when completing an order, and hence no need to recalculate shipping methods. Happy to be proven wrong, and maybe this is new behavior in Commerce 5, which would be odd. One final thing to ask is if you have the I'll investigate! |
I appreciate the quick responses! Here is our config (
|
Describe the bug
Postie is not triggering this
EVENT_BEFORE_FETCH_RATES
event when a cart is marked as completed to transition into order. Line vendor/verbb/postie/src/base/Provider.php:515 is not being reached because Postie does not see our plugin'sEVENT_BEFORE_FETCH_RATES
handler.This is our code where we have define our EVENT_BEFORE_FETCH_RATES handler and it is being triggered whenever any order is being updated (but not when a cart is marked as completed):
Steps to reproduce
EVENT_BEFORE_FETCH_RATES
in custom plugin based on https://verbb.io/craft-plugins/postie/docs/developers/events#the-beforeFetchRates-event exampleEVENT_BEFORE_FETCH_RATES
is not triggeredEVENT_BEFORE_FETCH_RATES
is triggeredCraft CMS version
Craft Pro 5.3.4
Plugin version
dev-craft-5
Multi-site?
Yes
Additional context
No response
The text was updated successfully, but these errors were encountered: