docs: docs for next release (#13303)
* added draft order plugin docs * fix vale error * added note about draft order being optional * add new shipping option - shipping method link * update user guides * generate * fix github icon * changes to shipping option type * document logger * reorder list * fixes * fixes
This commit is contained in:
@@ -38,6 +38,20 @@ The Fulfillment Module has the following links to other modules:
|
||||
</Table.Row>
|
||||
</Table.Header>
|
||||
<Table.Body>
|
||||
<Table.Row>
|
||||
<Table.Cell>
|
||||
[ShippingMethod](/references/cart/models/ShippingMethod) in [Cart Module](../../cart/page.mdx)
|
||||
</Table.Cell>
|
||||
<Table.Cell>
|
||||
[ShippingOption](/references/fulfillment/models/ShippingOption)
|
||||
</Table.Cell>
|
||||
<Table.Cell>
|
||||
Read-only - has one
|
||||
</Table.Cell>
|
||||
<Table.Cell>
|
||||
[Learn more](#cart-module)
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
<Table.Row>
|
||||
<Table.Cell>
|
||||
[Order](/references/order/models/Order) in [Order Module](../../order/page.mdx)
|
||||
@@ -127,6 +141,59 @@ The Fulfillment Module has the following links to other modules:
|
||||
|
||||
---
|
||||
|
||||
## Cart Module
|
||||
|
||||
Medusa defines a read-only link between the `ShippingMethod` data model of the [Cart Module](../../cart/page.mdx) and the `ShippingOption` data model. This means you can retrieve the details of a shipping method's shipping option, but you don't manage the links in a pivot table in the database. The shipping option of a shipping method is determined by the `shipping_option_id` property of the `ShippingMethod` data model.
|
||||
|
||||
This link allows you to retrieve the shipping option that a shipping method was created from.
|
||||
|
||||
<Note>
|
||||
|
||||
This read-only link was added in [Medusa v2.10.0](https://github.com/medusajs/medusa/releases/tag/v2.10.0)
|
||||
|
||||
</Note>
|
||||
|
||||
### Retrieve with Query
|
||||
|
||||
To retrieve the shipping option of a shipping method with [Query](!docs!/learn/fundamentals/module-links/query), pass `shipping_option.*` in `fields`:
|
||||
|
||||
<CodeTabs group="relation-query">
|
||||
<CodeTab label="query.graph" value="method">
|
||||
|
||||
```ts
|
||||
const { data: shippingMethods } = await query.graph({
|
||||
entity: "shipping_method",
|
||||
fields: [
|
||||
"shipping_option.*",
|
||||
],
|
||||
})
|
||||
|
||||
// shippingMethods[0].shipping_option
|
||||
```
|
||||
|
||||
</CodeTab>
|
||||
<CodeTab label="useQueryGraphStep" value="step">
|
||||
|
||||
```ts
|
||||
import { useQueryGraphStep } from "@medusajs/medusa/core-flows"
|
||||
|
||||
// ...
|
||||
|
||||
const { data: shippingMethods } = useQueryGraphStep({
|
||||
entity: "shipping_method",
|
||||
fields: [
|
||||
"shipping_option.*",
|
||||
],
|
||||
})
|
||||
|
||||
// shippingMethods[0].shipping_option
|
||||
```
|
||||
|
||||
</CodeTab>
|
||||
</CodeTabs>
|
||||
|
||||
---
|
||||
|
||||
## Order Module
|
||||
|
||||
The [Order Module](../../order/page.mdx) provides order-management functionalities.
|
||||
|
||||
Reference in New Issue
Block a user