Skip to content

Commit

Permalink
chore: i18n doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Fifciuu committed Apr 6, 2021
1 parent b7cb88e commit 4364831
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion packages/core/docs/commercetools/configuration.md
Expand Up @@ -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

Expand Down
Binary file added packages/core/docs/images/ct-states-checkout.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/core/docs/images/ct-states-myaccount.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/core/docs/images/ct-taxes.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4364831

Please sign in to comment.