-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Registered shipping rates validators are not running #39039
Comments
Hi @kooliahmd. Thank you for your report.
Join Magento Community Engineering Slack and ask your questions in #github channel. |
Hi @engcom-Hotel. Thank you for working on this issue.
|
Hello @kooliahmd, Thanks for the report and collaboration! We have tried to reproduce the issue in the latest 2.4-develop branch. In order to reproduce it we have made a custom module as follows: https://github.com/engcom-Hotel/magento2/tree/issue39039/app/code/Magz/Issue39039 But we are unable to reproduce it, can you please let us know if we missed anything? Thanks |
Dear @kooliahmd, We've observed that there haven't been any updates on this issue for quite some time. Therefore, we assume it's been resolved and will close it. Feel free to open a new ticket or reopen this one if you require further assistance. Regards |
Summary
Following this documentation in order to register a custom shipping rate validator, I found out that
shipping-rates-validator.js::validateAddressData
would never execute the registered validator as long as the default validator returns true.This is because
shipping-rates-validator.js
registers adefault-validator
and when it runs the validation it considers the rates as valid when at least on of the registered validators returned true.This is problematic, as the custom validator would not even run when the default validator returns true.
Examples
N/A
Proposed solution
Change this function
validateAddressData
inmodule-checkout/view/frontend/web/js/model/shipping-rates-validator.js
From:
To:
The text was updated successfully, but these errors were encountered: