Countries and states

Solidus uses the list of countries and states provided by Carmen , which uses the countries and states available in the Debian iso-codes package . Solidus creates new Spree::Country and Spree::State objects for each country and state.

Carmen is generally up-to-date and should provide Solidus with any country or state you would ever need.

Countries

If a country or state you require is not recognized, you can add it directly from your Rails console:

Ruby
    
      Spree::Country.create!(iso_name:"NEW COUNTRY", name:"New Country", states_required: true)

    
  

Some countries do not need to be divided into states or subregions. For those countries, the Spree::Country object's states_required field is set to false. You may wish to change this value for your custom country or any other country that you ship to.

States

A state is any sub-region of a country, whether that is a province, district, or territory. If the state you require is not recognized, you can add it directly from your Rails console:

Ruby
    
      Spree::State.create!(name: "New State", country_id: 1)

    
  

The country_id should match the country that the state belongs to.

Feedback

Solidus is an open source platform supported by the community. We encourage everyone using Solius to contribute back to the documentation and the code.

If you’re interested in contributing to the docs, get started with the contributing guidelines. If you see something that needs fixing and can’t do it yourself, please send us an email.