I'm trying to find the code I'll need to customize it, which will allow me to run a regular expression in the shipping address before approving an order.
If the regular expression matches, I'll have to return an error to the shopping cart page that says, "Sorry, we can not send to that address."
Any idea where can I find the code to do this?
I must approach it in this way because I can not send to certain states, sometimes even only to certain cities within certain states, so the mages built in regions do not eliminate it.
I already have this custom functionality to send only to certain states.
The problem is that I only have to restrict these locations in the area of the shipping address, but not the billing.
I have already allowed billing to be any address by restricting the shipment, in the front. But there are ways to get the restricted address in the shipping field, such as "use billing address" for shipping, etc.
So, as an infallible way to ensure that there are no orders that arrive at very specific shipping destinations, I want to validate the address on the server side and prevent the order from being made if it matches my usual expression.
Any help appreciated.