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 Store Module.
|
||||
|
||||
<Note type="soon">
|
||||
|
||||
Events are still in development, so this reference will change in the future.
|
||||
|
||||
</Note>
|
||||
|
||||
<EventsTable />
|
||||
@@ -243,7 +243,7 @@ In this guide, you’ll find common examples of how you can use the Store Module
|
||||
const storeModuleService: IStoreModuleService =
|
||||
request.scope.resolve(ModuleRegistrationName.STORE)
|
||||
|
||||
await storeModuleService.delete(request.params.id)
|
||||
await storeModuleService.delete("store_123")
|
||||
|
||||
res.status(200)
|
||||
}
|
||||
@@ -259,19 +259,13 @@ In this guide, you’ll find common examples of how you can use the Store Module
|
||||
initialize as initializeStoreModule,
|
||||
} from "@medusajs/store"
|
||||
|
||||
type ContextType = {
|
||||
params: {
|
||||
id: string
|
||||
}
|
||||
}
|
||||
|
||||
export async function DELETE(
|
||||
request: Request,
|
||||
{ params }: ContextType
|
||||
) {
|
||||
const storeModuleService = await initializeStoreModule()
|
||||
|
||||
await storeModuleService.delete(params.id)
|
||||
await storeModuleService.delete("store_123")
|
||||
}
|
||||
```
|
||||
|
||||
@@ -282,5 +276,5 @@ In this guide, you’ll find common examples of how you can use the Store Module
|
||||
|
||||
## More Examples
|
||||
|
||||
The [Store Module interface reference](/references/store) provides a reference to all the methods available for use with examples for each.
|
||||
The [Store Module's main service reference](/references/store) provides a reference to all the methods available for use with examples for each.
|
||||
|
||||
@@ -8,8 +8,6 @@ export const metadata = {
|
||||
|
||||
The Store Module is the `@medusajs/store` NPM package that provides store-related features in your Medusa and Node.js applications.
|
||||
|
||||
---
|
||||
|
||||
## Features
|
||||
|
||||
### Store Management
|
||||
@@ -28,31 +26,32 @@ const store = await storeModuleService.create({
|
||||
You can create multiple stores, each having its own configurations.
|
||||
|
||||
```ts
|
||||
const store1 = await storeModuleService.create({
|
||||
name: "USA Store",
|
||||
supported_currency_codes: ["usd"],
|
||||
})
|
||||
|
||||
const store2 = storeModuleService.create({
|
||||
name: "Europe Store",
|
||||
supported_currency_codes: [
|
||||
"eur",
|
||||
],
|
||||
})
|
||||
const stores = await storeModuleService.create([
|
||||
{
|
||||
name: "USA Store",
|
||||
supported_currency_codes: ["usd"],
|
||||
},
|
||||
{
|
||||
name: "Europe Store",
|
||||
supported_currency_codes: ["eur"],
|
||||
}
|
||||
])
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Configure Store Module
|
||||
|
||||
After installing the `@medusajs/store` package in your Medusa application, add it to the `modules` object in `medusa-config.js`:
|
||||
To use the Store Module, enable it in the `modules` object in `medusa-config.js`:
|
||||
|
||||
```js title="medusa-config.js"
|
||||
const { Modules } = require("@medusajs/modules-sdk")
|
||||
|
||||
// ...
|
||||
|
||||
const modules = {
|
||||
// ...
|
||||
store: {
|
||||
resolve: "@medusajs/store",
|
||||
},
|
||||
[Modules.STORE]: true,
|
||||
}
|
||||
```
|
||||
|
||||
@@ -111,11 +110,14 @@ For example:
|
||||
import { IStoreModuleService } from "@medusajs/types"
|
||||
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
|
||||
|
||||
const step1 = createStep("step-1", async (_, context) => {
|
||||
const step1 = createStep(
|
||||
"step-1",
|
||||
async (_, { container }) => {
|
||||
const storeModuleService: IStoreModuleService =
|
||||
context.container.resolve(
|
||||
container.resolve(
|
||||
ModuleRegistrationName.STORE
|
||||
)
|
||||
|
||||
const stores = await storeModuleService.list()
|
||||
})
|
||||
```
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
export const metadata = {
|
||||
title: `Relations between Store Module and Other Modules`,
|
||||
}
|
||||
|
||||
# {metadata.title}
|
||||
|
||||
This document showcases the link modules defined between the Store Module and other commerce modules.
|
||||
|
||||
## Currency Module
|
||||
|
||||
A store has a default currency. Medusa defines a link module that builds a relationship between the `Store` and `Currency` data models.
|
||||
|
||||

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