diff --git a/packages/core/docs/commercetools/configuration.md b/packages/core/docs/commercetools/configuration.md index e66332ba798..e74fd55791f 100644 --- a/packages/core/docs/commercetools/configuration.md +++ b/packages/core/docs/commercetools/configuration.md @@ -18,7 +18,38 @@ Commercetools configuration is located in two places: }] ``` -- `useNuxtI18nConfig` - when this property is set to true, `@vue-storefront/commercetools/nuxt` package will use `i18n` config object provided in `nuxt.config.js`. When set to false, `i18n` config should be declared directly inside this package configuration. You can read more about `i18n` config in Vue Storefront [here](../advanced/internationalization.md) +- `useNuxtI18nConfig` - when this property is set to true, `@vue-storefront/commercetools/nuxt` package will use `i18n` config object provided in `nuxt.config.js`. When set to false, `i18n` config should be declared directly inside this package configuration. You can read more generally about `i18n` config in Vue Storefront [here](../advanced/internationalization.md). On the other hand, there are things which are specific for the commercetools, you can read about them below. + +### Adding states for the country +In commercetools each state must have a specified tax rules. That's why we decided to have the state as a select field instead of a text one. + +In order to add a support for the new state, you have to: +- Add `states` field in the desired country inside a `i18n.countries` of your `nuxt.config.js` +```js +i18n: { + currency: 'USD', + country: 'US', + countries: [ + { name: 'US', + label: 'United States', + states: [ + 'California', + 'Nevada' + ] + }, + // ... + ] +} +``` +- In commercetools' dashboard, open *Settings* -> *Project settings* -> *Taxes* and click **Add rate** button for new states: + +![settings taxes for states](./../images/ct-taxes.png) + +After that, if you select `United States` as a country, there will be 2 available states. You can check it on Checkout's shipping & billing step and MyAccount's user shipping & billing addresses views. + +![comercetools states on my account](./../images/ct-states-myaccount.png) + +![comercetools states on the checkout](./../images/ct-states-checkout.png) ## Middleware Commercetools configuration diff --git a/packages/core/docs/images/ct-states-checkout.png b/packages/core/docs/images/ct-states-checkout.png new file mode 100644 index 00000000000..f275214854c Binary files /dev/null and b/packages/core/docs/images/ct-states-checkout.png differ diff --git a/packages/core/docs/images/ct-states-myaccount.png b/packages/core/docs/images/ct-states-myaccount.png new file mode 100644 index 00000000000..0b5ec5abedb Binary files /dev/null and b/packages/core/docs/images/ct-states-myaccount.png differ diff --git a/packages/core/docs/images/ct-taxes.png b/packages/core/docs/images/ct-taxes.png new file mode 100644 index 00000000000..d7eed648dd8 Binary files /dev/null and b/packages/core/docs/images/ct-taxes.png differ