Skip to content

Commit 25ed42f

Browse files
authored
docs: general fixes to cart and order concept docs (medusajs#13270)
1 parent e7b45f5 commit 25ed42f

File tree

10 files changed

+364
-118
lines changed

10 files changed

+364
-118
lines changed

www/apps/book/public/llms-full.txt

Lines changed: 87 additions & 47 deletions
Large diffs are not rendered by default.

www/apps/resources/app/commerce-modules/cart/concepts/page.mdx

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,42 @@ export const metadata = {
44

55
# {metadata.title}
66

7-
In this document, you’ll get an overview of the main concepts of a cart.
7+
In this document, you’ll learn about the main concepts related to carts in Medusa.
88

9-
## Shipping and Billing Addresses
9+
## Cart
1010

11-
A cart has a shipping and billing address. Both of these addresses are represented by the [Address data model](/references/cart/models/Address).
11+
A cart is the selection of product variants that a customer intends to purchase. It is represented by the [Cart data model](/references/cart/models/Cart).
1212

13-
![A diagram showcasing the relation between the Cart and Address data models](https://res.cloudinary.com/dza7lstvk/image/upload/v1711532392/Medusa%20Resources/cart-addresses_ls6qmv.jpg)
13+
A cart holds informations about:
14+
15+
- The items the customer wants to buy.
16+
- The customer's shipping and billing addresses.
17+
- The shipping methods used to fulfill the items after purchase.
18+
- The payment method and information necessary to complete the purchase.
19+
- These are stored and handled by the [Payment Module](../../payment/page.mdx).
1420

1521
---
1622

1723
## Line Items
1824

1925
A line item, represented by the [LineItem](/references/cart/models/LineItem) data model, is a quantity of a product variant added to the cart. A cart has multiple line items.
2026

21-
A line item stores some of the product variant’s properties, such as the `product_title` and `product_description`. It also stores data related to the item’s quantity and price.
22-
2327
<Note>
2428

2529
In the Medusa application, a product variant is implemented in the [Product Module](../../product/page.mdx).
2630

2731
</Note>
2832

33+
A line item stores some of the product variant’s properties, such as the `product_title` and `product_description`. It also stores data related to the item’s quantity and price.
34+
35+
---
36+
37+
## Shipping and Billing Addresses
38+
39+
A cart has a shipping and billing address. Both of these addresses are represented by the [Address data model](/references/cart/models/Address).
40+
41+
![A diagram showcasing the relation between the Cart and Address data models](https://res.cloudinary.com/dza7lstvk/image/upload/v1711532392/Medusa%20Resources/cart-addresses_ls6qmv.jpg)
42+
2943
---
3044

3145
## Shipping Methods
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
export const metadata = {
2-
title: `Item Fulfillment`,
2+
title: `Item Fulfillment Concepts`,
33
}
44

55
# {metadata.title}
66

7-
In this document, you’ll learn about the concepts of item fulfillment.
7+
In this document, you’ll learn about the concepts related to item fulfillment.
88

99
## Fulfillment Data Model
1010

1111
A fulfillment is the shipping and delivery of one or more items to the customer. It’s represented by the [Fulfillment data model](/references/fulfillment/models/Fulfillment).
1212

13+
A fulfillment can be created to fulfill orders, [returns](../../order/return/), [exchanges](../../order/exchange/page.mdx), and [claims](../../order/claim/page.mdx).
14+
1315
---
1416

1517
## Fulfillment Processing by a Fulfillment Provider
1618

17-
A fulfillment is associated with a fulfillment provider that handles all its processing, such as creating a shipment for the fulfillment’s items.
19+
A fulfillment is associated with a [fulfillment provider](../fulfillment-provider/page.mdx) that handles all its processing, such as creating a shipment for the fulfillment’s items.
1820

19-
The fulfillment is also associated with a shipping option of that provider, which determines how the item is shipped.
21+
The fulfillment is also associated with a [shipping option](../shipping-option/page.mdx) of that provider, which determines how the item is shipped.
2022

2123
![A diagram showcasing the relation between a fulfillment, fulfillment provider, and shipping option](https://res.cloudinary.com/dza7lstvk/image/upload/v1712331947/Medusa%20Resources/fulfillment-shipping-option_jk9ndp.jpg)
2224

2325
---
2426

25-
## data Property
27+
## data Property of Fulfillment Data Model
2628

2729
The `Fulfillment` data model has a `data` property that holds any necessary data for the third-party fulfillment provider to process the fulfillment.
2830

@@ -32,7 +34,7 @@ For example, the `data` property can hold the ID of the fulfillment in the third
3234

3335
## Fulfillment Items
3436

35-
A fulfillment is used to fulfill one or more items. Each item is represented by the `FulfillmentItem` data model.
37+
A fulfillment is used to fulfill one or more items. Each item is represented by the [FulfillmentItem data model](/references/fulfillment/models/FulfillmentItem).
3638

3739
The fulfillment item holds details relevant to fulfilling the item, such as barcode, SKU, and quantity to fulfill.
3840

@@ -42,14 +44,14 @@ The fulfillment item holds details relevant to fulfilling the item, such as barc
4244

4345
## Fulfillment Label
4446

45-
Once a shipment is created for the fulfillment, you can store its tracking number, URL, or other related details as a label, represented by the `FulfillmentLabel` data model.
47+
Once a shipment is created for the fulfillment, you can store its tracking number, URL, or other related details as a label, represented by the [FulfillmentLabel data model](/references/fulfillment/models/FulfillmentLabel).
4648

4749
---
4850

4951
## Fulfillment Status
5052

51-
The `Fulfillment` data model has three properties to keep track of the current status of the fulfillment:
53+
The [Fulfillment data model](/references/fulfillment/models/Fulfillment) has three properties to determine the current status of the fulfillment:
5254

53-
- `packed_at`: The date the fulfillment was packed. If set, then the fulfillment has been packed.
54-
- `shipped_at`: The date the fulfillment was shipped. If set, then the fulfillment has been shipped.
55-
- `delivered_at`: The date the fulfillment was delivered. If set, then the fulfillment has been delivered.
55+
- `packed_at`: The date the fulfillment was packed. If set, the fulfillment has been packed.
56+
- `shipped_at`: The date the fulfillment was shipped. If set, the fulfillment has been shipped.
57+
- `delivered_at`: The date the fulfillment was delivered. If set, the fulfillment has been delivered.

www/apps/resources/app/commerce-modules/fulfillment/module-options/page.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ export const metadata = {
1010

1111
# {metadata.title}
1212

13-
In this document, you'll learn about the options of the Fulfillment Module.
13+
In this document, you'll learn about the options of the Fulfillment Module. You can pass these options in `medusa-config.ts`.
1414

1515
## providers
1616

17-
The `providers` option is an array of fulfillment module providers.
17+
The `providers` option is an array of [Fulfillment Module Providers](../fulfillment-provider/page.mdx).
1818

1919
When the Medusa application starts, these providers are registered and can be used to process fulfillments.
2020

@@ -48,6 +48,6 @@ module.exports = defineConfig({
4848

4949
The `providers` option is an array of objects that accept the following properties:
5050

51-
- `resolve`: A string indicating either the package name of the module provider or the path to it relative to the `src` directory.
51+
- `resolve`: A string indicating either the package name of the module provider or its relative path.
5252
- `id`: A string indicating the provider's unique name or ID.
5353
- `options`: An optional object of the module provider's options.

www/apps/resources/app/commerce-modules/order/concepts/page.mdx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,22 @@ export const metadata = {
66

77
In this document, you’ll learn about orders and related concepts
88

9+
## Order
10+
11+
An order is a purchase made by a customer, either through the storefront or through the API. It is represented by the [Order data model](/references/order/models/Order).
12+
13+
An order holds information about:
14+
15+
- The purchased items.
16+
- The customer who made the order.
17+
- This is stored and handled by the [Customer Module](../../customer/page.mdx).
18+
- Payment and shipping information
19+
20+
---
21+
922
## Order Items
1023

11-
The items purchased in the order are represented by the [OrderItem data model](/references/order/models/OrderItem). An order can have multiple items.
24+
The items purchased in an order are represented by the [OrderItem data model](/references/order/models/OrderItem). An order can have multiple items.
1225

1326
![A diagram showcasing the relation between an order and its items.](https://res.cloudinary.com/dza7lstvk/image/upload/v1712304722/Medusa%20Resources/order-order-items_uvckxd.jpg)
1427

@@ -28,7 +41,7 @@ Each shipping method is represented by the [OrderShippingMethod data model](/ref
2841

2942
### data Property
3043

31-
When fulfilling the order, you can use a third-party fulfillment provider that requires additional custom data to be passed along from the order creation process.
44+
When fulfilling an order, you can use a third-party fulfillment provider that requires additional custom data to be passed along from the order creation process.
3245

3346
The `OrderShippingMethod` data model has a `data` property. It’s an object used to store custom data relevant later for fulfillment.
3447

@@ -38,7 +51,9 @@ The Medusa application passes the `data` property to the Fulfillment Module when
3851

3952
## Order Totals
4053

41-
The order’s total amounts (including tax total, total after an item is returned, etc…) are represented by the [OrderSummary data model](/references/order/models/OrderSummary).
54+
An order’s total amounts (including tax total, total after an item is returned, etc…) are represented by the [OrderSummary data model](/references/order/models/OrderSummary).
55+
56+
Refer to the [Retrieve Order Totals](../order-totals/page.mdx) guide to learn how to retrieve an order’s totals.
4257

4358
---
4459

@@ -48,4 +63,4 @@ Payments made on an order, whether they’re capture or refund payments, are rec
4863

4964
An order can have multiple transactions. The sum of these transactions must be equal to the order summary’s total. Otherwise, there’s an outstanding amount.
5065

51-
Learn more about transactions in [this guide](../transactions/page.mdx).
66+
Refer to the [Transactions](../transactions/page.mdx) guide to learn more.

0 commit comments

Comments
 (0)