docs: fix pricing query params in storefront guide + modules restructure (#9021)
- Fix pricing query params previously using `customer_group_id` and `customer_id` as expected / accepted queries and update information around them - Other: reorganize the introduction page of each module to show how to use it at the very beginning.
This commit is contained in:
1 parent
afb83b2408
commit
3eb2387746
20 files changed
+973
-964
No files matched your search
@@ -8,31 +8,6 @@ export const metadata = {
|
||||
|
||||
The Currency Module is the `@medusajs/currency` NPM package that provides currency-related features in your Medusa and Node.js applications.
|
||||
|
||||
## Features
|
||||
|
||||
### Currency Retrieval
|
||||
|
||||
List and retrieve currencies stored in your application.
|
||||
|
||||
```ts
|
||||
const currency = await currencyModuleService.retrieveCurrency("usd")
|
||||
```
|
||||
|
||||
### Support Currencies in Modules
|
||||
|
||||
Other commerce modules use currency codes in their data models or operations. You can use the Currency Module to retrieve a currency code and its details.
|
||||
|
||||
An example with the Region Module:
|
||||
|
||||
```ts
|
||||
const region = await regionModuleService.retrieveCurrency("reg_123")
|
||||
const currency = await currencyModuleService.retrieveCurrency(
|
||||
region.currency_code
|
||||
)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## How to Use Currency Module's Service
|
||||
|
||||
You can use the Currency Module's main service by resolving from the Medusa container the resource `ModuleRegistrationName.CURRENCY` imported from `@medusajs/utils`.
|
||||
@@ -97,3 +72,28 @@ const step1 = createStep("step-1", async (_, { container }) => {
|
||||
|
||||
</CodeTab>
|
||||
</CodeTabs>
|
||||
|
||||
---
|
||||
|
||||
## Features
|
||||
|
||||
### Currency Retrieval
|
||||
|
||||
List and retrieve currencies stored in your application.
|
||||
|
||||
```ts
|
||||
const currency = await currencyModuleService.retrieveCurrency("usd")
|
||||
```
|
||||
|
||||
### Support Currencies in Modules
|
||||
|
||||
Other commerce modules use currency codes in their data models or operations. You can use the Currency Module to retrieve a currency code and its details.
|
||||
|
||||
An example with the Region Module:
|
||||
|
||||
```ts
|
||||
const region = await regionModuleService.retrieveCurrency("reg_123")
|
||||
const currency = await currencyModuleService.retrieveCurrency(
|
||||
region.currency_code
|
||||
)
|
||||
```
|
||||
Reference in new issue
Block a user