How can I hide some fields from addressfield module (for example zip code) on checkout process if certain country is selected? E.G. If US country selected then hide postal code field. If CA country selected then show postal code.
-
The module developers have gone to great lengths to ensure that address fields are valid for the selected country. A zip code is a required part of a full US address, hence its inclusion. I'm not sure how easy it's going to be to unpick that, if memory serves the info all comes from a big array and I don't know if there's a non-hacky way to intercept it– Clive ♦Commented Jul 16, 2015 at 9:29
Add a comment
|
1 Answer
Clive is correct. The module already adjusts the form as appropriate. If you aren't seeing this, you must have something interfering with the Ajax based update of the form element.