Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
Improvements with validation model during the checkout
KrzysztofPajak1328ad42eeeb
diff --git a/src/Web/Grand.Web/Controllers/CheckoutController.cs b/src/Web/Grand.Web/Controllers/CheckoutController.csindex c7c6def1c..053612a7a 100644--- a/src/Web/Grand.Web/Controllers/CheckoutController.cs+++ b/src/Web/Grand.Web/Controllers/CheckoutController.cs@@ -507,10 +507,12 @@ namespace Grand.Web.Controllerselse{//new address- ModelState.Clear();var model = new CheckoutBillingAddressModel();await TryUpdateModelAsync(model.NewAddress, "BillingNewAddress");+ ModelState.Clear();+ TryValidateModel(model);+//custom address attributesvar customAttributes = await _mediator.Send(new GetParseCustomAddressAttributes() { Form = form });var customAttributeWarnings = await _addressAttributeParser.GetAttributeWarnings(customAttributes);@@ -661,9 +663,11 @@ namespace Grand.Web.Controllers}else{- ModelState.Clear();//new addressawait TryUpdateModelAsync(model.NewAddress, "ShippingNewAddress");+ ModelState.Clear();+ TryValidateModel(model);+//custom address attributesvar customAttributes = await _mediator.Send(new GetParseCustomAddressAttributes() { Form = form });var customAttributeWarnings = await _addressAttributeParser.GetAttributeWarnings(customAttributes);