docs: general updates and fixes (#13374)
* docs: general updates and fixes * fix lint errors
This commit is contained in:
1 parent
c717535ca2
commit
24199fa47a
25 files changed
+477
-396
No files matched your search
@@ -32,7 +32,7 @@ The order’s total amounts are stored in the `OrderSummary`'s `totals` property
|
||||
}
|
||||
```
|
||||
|
||||
To check the outstanding amount of the order, its transaction amounts are summed. Then, the following conditions are checked:
|
||||
To check the outstanding amount of the order, its transaction amounts (from the `Transaction` records) are summed. Then, the following conditions are checked:
|
||||
|
||||
<Table>
|
||||
<Table.Header>
|
||||
|
||||
@@ -10,7 +10,7 @@ export const metadata = {
|
||||
|
||||
# {metadata.title}
|
||||
|
||||
In this document, you'll learn about the options of the Payment Module.
|
||||
In this document, you'll learn about the options you can pass to the Payment Module.
|
||||
|
||||
## All Module Options
|
||||
|
||||
@@ -97,7 +97,7 @@ In this document, you'll learn about the options of the Payment Module.
|
||||
|
||||
## providers Option
|
||||
|
||||
The `providers` option is an array of payment module providers.
|
||||
The `providers` option is an array of payment module providers to be registered in your Medusa application.
|
||||
|
||||
When the Medusa application starts, these providers are registered and can be used to process payments.
|
||||
|
||||
@@ -131,6 +131,8 @@ module.exports = defineConfig({
|
||||
|
||||
The `providers` option is an array of objects that accept the following properties:
|
||||
|
||||
- `resolve`: A string indicating the package name of the module provider or the path to it relative to the `src` directory.
|
||||
- `resolve`: A string indicating the package name of the module provider or the path to it.
|
||||
- `id`: A string indicating the provider's unique name or ID.
|
||||
- `options`: An optional object of the module provider's options.
|
||||
- `options`: An optional object of the module provider's options.
|
||||
|
||||
Refer to the [Payment Module Providers](../payment-provider/page.mdx) documentation to learn more.
|
||||
@@ -12,7 +12,7 @@ A payment collection stores payment details related to a resource, such as a car
|
||||
|
||||
Every purchase or request for payment starts with a payment collection. The collection holds details necessary to complete the payment, including:
|
||||
|
||||
- The [payment sessions](../payment-session/page.mdx) that represents the payment amount to authorize.
|
||||
- The [payment sessions](../payment-session/page.mdx) that represent the payment amount to authorize.
|
||||
- The [payments](../payment/page.mdx) that are created when a payment session is authorized. They can be captured and refunded.
|
||||
- The [payment providers](../payment-provider/page.mdx) that handle the processing of each payment session, including the authorization, capture, and refund.
|
||||
|
||||
@@ -32,8 +32,6 @@ You can use this to accept payments in increments or split payments across payme
|
||||
|
||||
The Cart Module provides cart management features. However, it doesn’t provide any features related to accepting payment.
|
||||
|
||||
During checkout, the Medusa application links a cart to a payment collection, which will be used for further payment processing.
|
||||
|
||||
It also implements the payment flow during checkout as explained in [this documentation](../payment-flow/page.mdx).
|
||||
During checkout, the Medusa application links a cart to a payment collection, which will be used for further payment processing. It also implements the [payment flow](../payment-flow/page.mdx) during checkout.
|
||||
|
||||

|
||||
@@ -4,13 +4,13 @@ export const metadata = {
|
||||
|
||||
# {metadata.title}
|
||||
|
||||
In this document, you’ll learn about the main concepts in the Pricing Module.
|
||||
In this guide, you’ll learn about the main concepts in the Pricing Module.
|
||||
|
||||
## Price Data Model
|
||||
|
||||
The [Price](/references/pricing/models/Price) data model represents a specific price for a resource. For example, the price of a product variant in the USD currency.
|
||||
|
||||
The `Price` data model has an `amount` property that represents the monetary value of the price. It's stored as an integer in base units. For example, `$20.00` is stored as `20`.
|
||||
The `Price` data model has an `amount` property that represents the monetary value of the price. It's stored as an integer in base or major units. For example, `$20.00` is stored as `20`, and `$20.5` is stored as `20.5`.
|
||||
|
||||
The `Price` data model belongs to other data models like `PriceSet` and `PriceList` to provide a variety of pricing features, as explained below.
|
||||
|
||||
@@ -18,9 +18,9 @@ The `Price` data model belongs to other data models like `PriceSet` and `PriceLi
|
||||
|
||||
## Price Set
|
||||
|
||||
A [PriceSet](/references/pricing/models/PriceSet) represents a collection of prices that are linked to a resource (for example, a product variant or a shipping option).
|
||||
A [PriceSet](/references/pricing/models/PriceSet) represents a collection of prices that are linked to a resource. For example, a product variant can have a price set that includes prices in multiple currencies, such as USD and EUR.
|
||||
|
||||
Each of these prices is represented by the [Price data model](/references/pricing/models/Price).
|
||||
Each of these prices is represented by the [Price data model](#price-data-model).
|
||||
|
||||

|
||||
|
||||
@@ -28,8 +28,10 @@ Each of these prices is represented by the [Price data model](/references/pricin
|
||||
|
||||
## Price List
|
||||
|
||||
A [PriceList](/references/pricing/models/PriceList) is a group of prices only enabled if their conditions and rules are satisfied.
|
||||
A [PriceList](/references/pricing/models/PriceList) is a group of prices that are only enabled when their conditions and rules are satisfied. For example, you can apply special prices to customers in the VIP group.
|
||||
|
||||
When the conditions are met, the prices in the price list override the default prices in a price set.
|
||||
|
||||
A price list has optional `start_date` and `end_date` properties that indicate the date range in which a price list can be applied.
|
||||
|
||||
Its associated prices are represented by the `Price` data model.
|
||||
Its associated prices are represented by the [Price data model](#price-data-model).
|
||||
@@ -6,11 +6,11 @@ export const metadata = {
|
||||
|
||||
# {metadata.title}
|
||||
|
||||
In this document, you'll learn what an application method is.
|
||||
In this guide, you'll learn what an application method is in the Promotion Module.
|
||||
|
||||
## What is an Application Method?
|
||||
|
||||
The [ApplicationMethod data model](/references/promotion/models/ApplicationMethod) defines how a promotion is applied:
|
||||
The [ApplicationMethod data model](/references/promotion/models/ApplicationMethod) defines how a promotion is applied. It has the following properties that determine its behavior:
|
||||
|
||||
<Table>
|
||||
<Table.Header>
|
||||
@@ -24,6 +24,11 @@ The [ApplicationMethod data model](/references/promotion/models/ApplicationMetho
|
||||
|
||||
Purpose
|
||||
|
||||
</Table.HeaderCell>
|
||||
<Table.HeaderCell>
|
||||
|
||||
Possible Values
|
||||
|
||||
</Table.HeaderCell>
|
||||
</Table.Row>
|
||||
</Table.Header>
|
||||
@@ -38,6 +43,11 @@ The [ApplicationMethod data model](/references/promotion/models/ApplicationMetho
|
||||
|
||||
Does the promotion discount a fixed amount or a percentage?
|
||||
|
||||
</Table.Cell>
|
||||
<Table.Cell>
|
||||
|
||||
`fixed`, `percentage`
|
||||
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
<Table.Row>
|
||||
@@ -48,7 +58,12 @@ The [ApplicationMethod data model](/references/promotion/models/ApplicationMetho
|
||||
</Table.Cell>
|
||||
<Table.Cell>
|
||||
|
||||
Is the promotion applied on a cart item, shipping method, or the entire order?
|
||||
Is the promotion applied to a cart item, shipping method, or the entire order?
|
||||
|
||||
</Table.Cell>
|
||||
<Table.Cell>
|
||||
|
||||
`items`, `shipping_methods`, `order`
|
||||
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
@@ -60,7 +75,12 @@ The [ApplicationMethod data model](/references/promotion/models/ApplicationMetho
|
||||
</Table.Cell>
|
||||
<Table.Cell>
|
||||
|
||||
Is the discounted amount applied on each item or split between the applicable items?
|
||||
Is the discounted amount applied to each item or split between the applicable items?
|
||||
|
||||
</Table.Cell>
|
||||
<Table.Cell>
|
||||
|
||||
`each`, `across`
|
||||
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
@@ -69,13 +89,13 @@ The [ApplicationMethod data model](/references/promotion/models/ApplicationMetho
|
||||
|
||||
## Target Promotion Rules
|
||||
|
||||
When the promotion is applied to a cart item or a shipping method, you can restrict which items/shipping methods the promotion is applied to.
|
||||
When the promotion is applied to a cart item or a shipping method (in other words, when `target_type` is `items` or `shipping_methods`), you can restrict which items/shipping methods the promotion is applied to.
|
||||
|
||||
The `ApplicationMethod` data model has a collection of `PromotionRule` records to restrict which items or shipping methods the promotion applies to. The `target_rules` property represents this relation.
|
||||
The `ApplicationMethod` data model has a collection of [PromotionRule](/references/promotion/models/PromotionRule) records to restrict which items or shipping methods the promotion applies to. The `target_rules` property in the `ApplicationMethod` represents this relation.
|
||||
|
||||

|
||||
|
||||
In this example, the promotion is only applied on products in the cart having the SKU `SHIRT`.
|
||||
In this example, the promotion is only applied to product variants in the cart that have the SKU `SHIRT`.
|
||||
|
||||
---
|
||||
|
||||
@@ -83,8 +103,8 @@ In this example, the promotion is only applied on products in the cart having th
|
||||
|
||||
When the promotion’s type is `buyget`, you must specify the “buy X” condition. For example, a cart must have two shirts before the promotion can be applied.
|
||||
|
||||
The application method has a collection of `PromotionRule` items to define the “buy X” rule. The `buy_rules` property represents this relation.
|
||||
The application method has a collection of `PromotionRule` items to define the “buy X” rule. The `buy_rules` property in the `ApplicationMethod` represents this relation.
|
||||
|
||||

|
||||
|
||||
In this example, the cart must have two products with the SKU `SHIRT` for the promotion to be applied.
|
||||
In this example, the cart must have two product variants with the SKU `SHIRT` for the promotion to be applied.
|
||||
@@ -4,16 +4,16 @@ export const metadata = {
|
||||
|
||||
# {metadata.title}
|
||||
|
||||
In this document, you’ll learn about the main concepts in the Stock Location Module.
|
||||
In this guide, you’ll learn about the main concepts in the Stock Location Module.
|
||||
|
||||
## Stock Location
|
||||
|
||||
A stock location, represented by the `StockLocation` data model, represents a location where stock items are kept. For example, a warehouse.
|
||||
A stock location, represented by the [StockLocation data model](/references/stock-location-next/models/StockLocation), represents a location where stock items are kept. For example, a warehouse.
|
||||
|
||||
Medusa uses stock locations to provide inventory details, from the Inventory Module, per location.
|
||||
Medusa uses stock locations to provide inventory details, stored and managed by the [Inventory Module](../../inventory/concepts/page.mdx), per location.
|
||||
|
||||
---
|
||||
|
||||
## StockLocationAddress
|
||||
|
||||
The `StockLocationAddress` data model belongs to the `StockLocation` data model. It provides more detailed information of the location, such as country code or street address.
|
||||
The [StockLocationAddress data model](/references/stock-location-next/models/StockLocationAddress) belongs to the `StockLocation` data model. It provides more detailed information about the location, such as country code or street address.
|
||||
@@ -10,7 +10,7 @@ export const metadata = {
|
||||
|
||||
# {metadata.title}
|
||||
|
||||
In this document, you'll learn about the options of the User Module.
|
||||
In this guide, you'll learn about the options you can pass to the User Module.
|
||||
|
||||
## Module Options
|
||||
|
||||
@@ -63,7 +63,7 @@ module.exports = defineConfig({
|
||||
|
||||
### Environment Variables
|
||||
|
||||
Make sure to add the necessary environment variables for the above options in `.env`:
|
||||
Make sure to add the necessary environment variables for the above options to your `.env` file:
|
||||
|
||||
```bash
|
||||
JWT_SECRET=supersecret
|
||||
|
||||
Reference in new issue
Block a user