Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently there is no UI to remove some US states from shipping and billing country list at checkout. It will be nice to have this feature added to commerce module.
Comments
Comment #1
amateescu CreditAttribution: amateescu commentedMoving to the right project.
Comment #2
rszrama CreditAttribution: rszrama commentedMarking this a duplicate of #1829900: [meta] Address Field 2.x needs pluggable administrative areas and an actual API. In the meantime, you just have to use hook_form_alter().
Comment #3
philsward CreditAttribution: philsward commentedThis page came up first when searching for drupal commerce addressfield hide state, so I'll leave this here...
You can "hide" the states from checkout using CSS, display:none; It's not ideal, but it's better than offering products to folks in all of the outlying United States locations when there's no easy way to actually offer cost-effective shipping to those locations...
Here's a template of CSS to get you started:
NOTE: If you're using the chosen module, go add the following to the "enable area" of chosen, to disable it on the checkout forms:
(Yes, this is counter intuitive)
Comment #4
nitheesh CreditAttribution: nitheesh at Power CMS Technology commentedA better solution is to do a hook_addressfield_administrative_areas_alter() and then restrict the administrative areas keyed by the country.