diff --git a/src/Modules/SimplCommerce.Module.Checkouts/Areas/Checkouts/ViewModels/ShippingAddressVm.cs b/src/Modules/SimplCommerce.Module.Checkouts/Areas/Checkouts/ViewModels/ShippingAddressVm.cs index b9ab9c192..b7277bda3 100644 --- a/src/Modules/SimplCommerce.Module.Checkouts/Areas/Checkouts/ViewModels/ShippingAddressVm.cs +++ b/src/Modules/SimplCommerce.Module.Checkouts/Areas/Checkouts/ViewModels/ShippingAddressVm.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -12,6 +13,9 @@ public class ShippingAddressVm public string ContactName { get; set; } + [Required(ErrorMessage = "Phone number is required")] + [Phone(ErrorMessage = "Please enter a valid phone number")] + [StringLength(20, MinimumLength = 10, ErrorMessage = "Phone number must be between 10 and 20 characters")] public string Phone { get; set; } public string AddressLine1 { get; set; } diff --git a/src/Modules/SimplCommerce.Module.Checkouts/Areas/Checkouts/Views/Checkout/Shipping.cshtml b/src/Modules/SimplCommerce.Module.Checkouts/Areas/Checkouts/Views/Checkout/Shipping.cshtml index 708309f2c..899885c77 100644 --- a/src/Modules/SimplCommerce.Module.Checkouts/Areas/Checkouts/Views/Checkout/Shipping.cshtml +++ b/src/Modules/SimplCommerce.Module.Checkouts/Areas/Checkouts/Views/Checkout/Shipping.cshtml @@ -83,7 +83,8 @@
- +
@@ -174,7 +175,8 @@
- +