Hi,
I have noticed that when a customer enters a Zip+4 in their address, during checkout, the system will not calculate tax. This works perfectly if they only enter the first 5 digits of the Zip code (my customers are in USA).
This makes sense as my tax setup is using Tax by County & State & Zip and I have tax rates for each Zip code I collect for but the zip codes only have the 5 digits.
How can I force the Zip Code field to only allow 5 Digits?
I looked at Nop.Web.Validators.Customer.CustomerInfoValidator and added a rule for the Zip code as follows:
if (customerSettings.ZipPostalCodeRequired && customerSettings.ZipPostalCodeEnabled)
{
RuleFor(x => x.ZipPostalCode).NotEmpty().WithMessage(localizationService.GetResource("Account.Fields.ZipPostalCode.Required"));
RuleFor(x => x.ZipPostalCode).length(5).WithMessage(localizationService.GetResource("Account.Fields.ZipPostalCode.Length"));
}
However, the rule did not fire when I tested.
Any ideas on how to resolve my problem?