- Change existing data model guides and add new ones for DML - Change module's docs around service factory + remove guides that are now necessary - Hide/remove all mentions of module relationships, or label them as coming soon. - Change all data model creation snippets to use DML - use `property` instead of `field` when referring to a data model's properties. - Fix all snippets in commerce module guides to use new method suffix (no more main model methods) - Rework recipes, removing/hiding a lot of sections as a lot of recipes are incomplete with the current state of DML. ### Other changes - Highlight fixes in some guides - Remove feature flags guide - Fix code block styles when there are no line numbers. ### Upcoming changes in other PRs - Re-generate commerce module references (for the updates in the method names) - Ensure that the data model references are generated correctly for models using DML. - (probably at a very later point) revisit recipes
44 lines
1.8 KiB
Plaintext
44 lines
1.8 KiB
Plaintext
export const metadata = {
|
||
title: `Cart Concepts`,
|
||
}
|
||
|
||
# {metadata.title}
|
||
|
||
In this document, you’ll get an overview of the main concepts of a cart.
|
||
|
||
## Shipping and Billing Addresses
|
||
|
||
A cart has a shipping and billing address. Both of these addresses are represented by the [Address data model](/references/cart/models/Address).
|
||
|
||

|
||
|
||
---
|
||
|
||
## Line Items
|
||
|
||
A line item, represented by the `LineItem` data model, is a product variant added to the cart. A cart has multiple line items.
|
||
|
||
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.
|
||
|
||
<Note>
|
||
|
||
A product variant can be from the [Product Module](../../product/page.mdx) but can also be a custom item used only in this cart.
|
||
|
||
</Note>
|
||
|
||
---
|
||
|
||
## Shipping Methods
|
||
|
||
A shipping method, represented by the [ShippingMethod data model](/references/cart/models/ShippingMethod), is used to fulfill the items in the cart after the order is placed. A cart can have more than one shipping method.
|
||
|
||
If the shipping method is created from a shipping option, available through the [Fulfillment Module](../../fulfillment/page.mdx), its ID is stored in the `shipping_option_id`.
|
||
|
||
A shipping method can also be a custom method associated with this cart only.
|
||
|
||
### data Property
|
||
|
||
After an order is placed, you may use a third-party fulfillment provider to fulfill its shipments. If the fulfillment provider requires additional custom data to be passed along from the checkout process, you can add this data in the `ShippingMethod`'s `data` property.
|
||
|
||
The `data` property is an object used to store custom data relevant later for fulfillment.
|