I added a custom JS validation rule for customer address tax_id field, following this instructions.
But the JS validations can be easely skiped, so how can I reproduce the frontend JS validation in my custom module PHP codes?
Thanks in advance.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
M2 checkout uses web API to communicate with the backend. You can bind your custom plugins(http://devdocs.magento.com/guides/v2.2/extension-dev-guide/plugins.html) to any web API service.
For your case it should be
So, just create a plugin and put your validation there.