瀏覽代碼

docs: Add some docs

Michael Bromley 2 年之前
父節點
當前提交
254154f2c3

+ 24 - 1
docs/content/developer-guide/customizing-the-order-process/index.md

@@ -9,9 +9,32 @@ Vendure defines an order process which is based on a [finite state machine]({{<
 
 So, as an example, all orders begin in the `AddingItems` state. This means that the Customer is adding items to his or her shopping cart. From there, the Order can transition to the `ArrangingPayment` state. A diagram of the default states and transitions can be found in the [Order Workflow guide]({{< relref "order-workflow" >}}).
 
+## Customizing the Default Order Process
+
+Vendure ships with a [defaultOrderProcess]({{< relref "order-process" >}}#defaultorderprocess) which is suitable for most use-cases. However, it is possible to customize the process to better match your business needs. For example, you might want to disable some of the constraints that are imposed by the default process, such as the requirement that a Customer must have a shipping address before the Order can be completed.
+
+This can be done by creating a custom version of the default process using the [configureDefaultOrderProcess]({{< relref "order-process" >}}#configuredefaultorderprocess) function, and then passing it to the [`OrderOptions.process`]({{< relref "order-options" >}}#process) config property.
+
+```TypeScript
+import { configureDefaultOrderProcess, VendureConfig } from '\@vendure/core';
+
+const myCustomOrderProcess = configureDefaultOrderProcess({
+  // Disable the constraint that requires
+  // Orders to have a shipping method assigned
+  // before payment.
+  arrangingPaymentRequiresShipping: false,
+});
+
+export const config: VendureConfig = {
+  orderOptions: {
+    process: [myCustomOrderProcess],
+  },
+};
+```
+
 ## Defining custom states and transitions
 
-Sometimes you might need to modify the default Order process to better match your business needs. This is done by defining one or more [`OrderProcess`]({{< relref "order-process" >}}) objects and passing them to the [`OrderOptions.process`]({{< relref "order-options" >}}#process) config property.
+Sometimes you might need to extend things beyond what is provided by the default Order process to better match your business needs. This is done by defining one or more [`OrderProcess`]({{< relref "order-process" >}}) objects and passing them to the [`OrderOptions.process`]({{< relref "order-options" >}}#process) config property.
 
 ### Example: Adding a new state
 

+ 2 - 0
docs/content/developer-guide/multi-vendor-marketplaces/_index.md

@@ -19,6 +19,8 @@ All the concepts presented here have been implemented in our [example multi-vend
 **Note:** the [example multi-vendor plugin](https://github.com/vendure-ecommerce/vendure/tree/master/packages/dev-server/example-plugins/multivendor-plugin) is for educational purposes only, and for the sake of clarity leaves out several parts that would be required in a production-ready solution, such as email verification and setup of a real payment solution.
 {{< /alert >}}
 
+{{< figure src="./aggregate-order.webp" title="The Admin UI Aggregate Order screen" >}}
+
 ## Sellers, Channels & Roles
 
 The core of Vendure's multi-vendor support is Channels. Read the [Channels guide]({{< relref "/developer-guide/channels" >}}) to get a more detailed understanding of how they work.

二進制
docs/content/developer-guide/multi-vendor-marketplaces/aggregate-order.webp