docs: edits and fixes to commerce module docs (#7468)
Apply edits and fixes to the commerce modules docs
This commit is contained in:
1 parent
130de74d6d
commit
2c5ba408d4
160 files changed
+6400
-3790
No files matched your search
@@ -8,4 +8,10 @@ export const metadata = {
|
||||
|
||||
Find in this reference the list of events emitted by the Region Module.
|
||||
|
||||
<Note type="soon">
|
||||
|
||||
Events are still in development, so this reference will change in the future.
|
||||
|
||||
</Note>
|
||||
|
||||
<EventsTable />
|
||||
@@ -263,4 +263,4 @@ In this guide, you’ll find common examples of how you can use the Region Modul
|
||||
|
||||
## More Examples
|
||||
|
||||
The [Region Module interface reference](/references/region) provides a reference to all the methods available for use with examples for each.
|
||||
The [Region Module's main service reference](/references/region) provides a reference to all the methods available for use with examples for each.
|
||||
@@ -8,8 +8,6 @@ export const metadata = {
|
||||
|
||||
The Region Module is the `@medusajs/region` NPM package that provides region-related features in your Medusa and Node.js applications.
|
||||
|
||||
---
|
||||
|
||||
## What is a Region?
|
||||
|
||||
A region represents the area you sell products in. Each region can cover multiple countries, but uses a single currency.
|
||||
@@ -48,7 +46,7 @@ const regions = await regionModuleService.create([
|
||||
|
||||
### Different Settings Per Region
|
||||
|
||||
Each region has its own settings, such as what countries belong to a region or its tax settings. When using other commerce modules such as the Tax Module or Payment Module, each region has different tax rates, payment providers, and more.
|
||||
Each region has its own settings, such as what countries belong to a region or its tax settings. Each region has different tax rates, payment providers, and more provided by other commerce modules.
|
||||
|
||||
```ts
|
||||
const regions = await regionModuleService.create([
|
||||
@@ -62,7 +60,7 @@ const regions = await regionModuleService.create([
|
||||
name: "United States of America",
|
||||
currency_code: "usd",
|
||||
countries: ["us"],
|
||||
automatic_taxes: false,
|
||||
payment_providers: ["stripe"]
|
||||
},
|
||||
])
|
||||
```
|
||||
@@ -71,14 +69,16 @@ const regions = await regionModuleService.create([
|
||||
|
||||
## Configure Region Module
|
||||
|
||||
After installing the `@medusajs/region` package in your Medusa application, add it to the `modules` object in `medusa-config.js`:
|
||||
To use the Region Module, enable it in the `modules` object in `medusa-config.js`:
|
||||
|
||||
```js title="medusa-config.js"
|
||||
const { Modules } = require("@medusajs/modules-sdk")
|
||||
|
||||
// ...
|
||||
|
||||
const modules = {
|
||||
// ...
|
||||
region: {
|
||||
resolve: "@medusajs/region",
|
||||
},
|
||||
[Modules.REGION]: true,
|
||||
}
|
||||
```
|
||||
|
||||
@@ -137,9 +137,11 @@ For example:
|
||||
import { IRegionModuleService } from "@medusajs/types"
|
||||
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
||||
|
||||
const step1 = createStep("step-1", async (_, context) => {
|
||||
const step1 = createStep(
|
||||
"step-1",
|
||||
async (_, { container }) => {
|
||||
const regionModuleService: IRegionModuleService =
|
||||
context.container.resolve(
|
||||
container.resolve(
|
||||
ModuleRegistrationName.REGION
|
||||
)
|
||||
|
||||
|
||||
@@ -4,14 +4,28 @@ export const metadata = {
|
||||
|
||||
# {metadata.title}
|
||||
|
||||
When Commerce Modules are used together in a Medusa application, the Medusa application handles building the relations between these modules.
|
||||
|
||||
This document showcases the relation between the Region Module and other Commerce Modules.
|
||||
This document showcases the link modules defined between the Region Module and other commerce modules.
|
||||
|
||||
## Cart Module
|
||||
|
||||
Carts are associated with a region. The Medusa application forms a relation between the `Region` and the `Cart` data models.
|
||||
Carts are associated with a region. Medusa defines a link module that builds a relationship between the `Region` and the `Cart` data models.
|
||||
|
||||

|
||||

|
||||
|
||||
The cart then uses the same currency as the region. During checkout, the cart's taxes, payment, and fulfillment providers are available based on the region's settings.
|
||||
|
||||
---
|
||||
|
||||
## Order Module
|
||||
|
||||
An order is associated with the customer's region. Medusa defines a link module that builds a relationship between the `Order` and `Region` data models.
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Payment Module
|
||||
|
||||
You can specify for each region which payment providers are available. Medusa defines a link module that builds a relationship between the `PaymentProvider` and the `Region` data models.
|
||||
|
||||

|
||||
Reference in new issue
Block a user