Page 1 of 1

Add more field to be validated in shippinginfoform

Posted: Mon Jul 29, 2013 7:28 am
by ankitpatni
Hi
I am using broadleaf ecommerce 2.2 .I found ShippingInfOFormValidator.class in the broardleaf framework.
How i can add more validator field in the same form.

Re: Add more field to be validated in shippinginfoform

Posted: Tue Jul 30, 2013 9:02 am
by elbertbautista
You can extend ShippingInfoFormValidator to perform your own custom validations. There's a built in example already in the framework, see org.broadleafcommerce.core.web.checkout.validator.USShippingInfoFormValidator. You can then extend BroadleafCheckoutController to inject your custom validator.

Re: Add more field to be validated in shippinginfoform

Posted: Wed Jul 31, 2013 5:15 am
by ankitpatni
Hi elbertbautista ,

Thanks for a quick reply
Yeah, even i had gone through that example, I have created my own validator by looking at that example, but i am stuck at how to inject that in the BroadleafCheckoutController.
I don't have any idea about how to do that.
Will be glad if you can help me in this.

Thanks & Regards
Ankit Patni

Re: Add more field to be validated in shippinginfoform

Posted: Mon Aug 05, 2013 11:46 am
by elbertbautista
You would inject it like any other Spring resource.
Extend BroadleafCheckoutController, override the method you need to and use your own custom validator when necessary.