Links between Marketplace Module and Other Modules
This document showcases the module links defined between the Marketplace Module and other Commerce Modules.Summary
The Marketplace Module has the following links to other modules: Read-only links are used to query data across modules, but the relations aren’t stored in a pivot table in the database.| First Data Model | Second Data Model | Type | Description |
|---|---|---|---|
| OrderSet | Order | Stored - one-to-many | Associates an order set with its multiple vendor orders |
| OrderSet | Customer | Read-only - has one | Retrieves the customer who owns the order set |
| OrderSet | Cart | Read-only - has one | Retrieves the cart that was used to create the order set |
| OrderSet | SalesChannel | Read-only - has one | Retrieves the sales channel of the order set |
| OrderSet | PaymentCollection | Read-only - has one | Retrieves the payment collection for the order set |
Order Module
Mercur defines a link between the Marketplace Module’sOrderSet data model and the Order Module’s Order data model. This allows an order set to be associated with multiple orders (one per seller in a multi-vendor cart).
Retrieve with Query
To retrieve the orders of an order set with Query, passorder.* in fields:
- query.graph
- useQueryGraphStep
Manage with Link
To manage the orders of an order set, use Link:- link.create
- createRemoteLinkStep
Customer Module
Mercur defines a read-only link between the Marketplace Module’sOrderSet data model and the Customer Module’s Customer data model. Because the link is read-only from the OrderSet’s side, you can only retrieve the customer of an order set, and not the other way around.
Retrieve with Query
To retrieve the customer of an order set with Query, passcustomer.* in fields:
- query.graph
- useQueryGraphStep
Cart Module
Mercur defines a read-only link between the Marketplace Module’sOrderSet data model and the Cart Module’s Cart data model. Because the link is read-only from the OrderSet’s side, you can only retrieve the cart of an order set, and not the other way around.
The cart of an order set is determined by the cart_id property of the OrderSet data model.
Retrieve with Query
To retrieve the cart of an order set with Query, passcart.* in fields:
- query.graph
- useQueryGraphStep
Sales Channel Module
Mercur defines a read-only link between the Marketplace Module’sOrderSet data model and the Sales Channel Module’s SalesChannel data model. Because the link is read-only from the OrderSet’s side, you can only retrieve the sales channel of an order set, and not the other way around.
The sales channel of an order set is determined by the sales_channel_id property of the OrderSet data model.
Retrieve with Query
To retrieve the sales channel of an order set with Query, passsales_channel.* in fields:
- query.graph
- useQueryGraphStep
Payment Module
Mercur defines a read-only link between the Marketplace Module’sOrderSet data model and the Payment Module’s PaymentCollection data model. Because the link is read-only from the OrderSet’s side, you can only retrieve the payment collection of an order set, and not the other way around.
The payment collection of an order set is determined by the payment_collection_id property of the OrderSet data model.
Retrieve with Query
To retrieve the payment collection of an order set with Query, passpayment_collection.* in fields:
- query.graph
- useQueryGraphStep