I'm trying to prevent members from using a PO box on the ship to address because fed-Ex doesn't deliver to PO, FPO or APO boxes.
I was thinking that I would just write another event for the OrderInfo on the before event:
public override void Init() { CMS.Ecommerce.OrderInfo.TYPEINFO.Events.Insert.Before += Insert_Before; }
But in the Insert_Before event I don't know how to send an error message, and not allow the order to go through and give them an opportunity to give a real address. Any ideas?
In your event, simply throw a new exception and set the message to whatever you want. You should be able to capture that exception on the front side. I believe you can cancel the event from processing as well.
throw
Please, sign in to be able to submit a new answer.