Address validation fails if the country has no postal code

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 6 años
I am currently working in a project which uses NopCommerce 3.80. But I am facing a problem validating address where country has no postal code.

What is require:
1. For countries like USA, Canada postal code should be required
2. For all other countrie spostal code should be optional

Is it currently possible in NopCommerce? or am I missing something? Is it possible without tweaking the code?

Thanks a lot.
Hace 6 años
omanaye wrote:
I am currently working in a project which uses NopCommerce 3.80. But I am facing a problem validating address where country has no postal code.

What is require:
1. For countries like USA, Canada postal code should be required
2. For all other countrie spostal code should be optional

Is it currently possible in NopCommerce? or am I missing something? Is it possible without tweaking the code?

Thanks a lot.


From what i can see the postcode is not dependent on the country.
Hace 6 años
I modified the validation. My validation is working fine now. When the user selected USA, Canada the postal code is required and if the user selected  all other country postal code is optional.It shows validation errors.

I have difficulties to add the red asterisk (*) on postal code field if the user select USA or Canada countries and remove the red asterisk (*) if another country is selected.


I was trying to make changes in _CreateOrUpdateAddress.cshtml in JQuery without success. Do you know how to tweak the code?


Thanks!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.