Customizing the OrderProcess #2427
-
Hi, I'm trying to figure out how to create a custom "check" before an order can be moved to checkout. In my store I want to have at maximum X number of orders waiting before a new order can be placed. It's for a small business where the stock is created on demand. So, we only want to have X number of orders available. I was looking at the OrderProcess, to create a custom rule based on number of active orders (Waiting fulfilment) but I'm a but unsure how to start. Should my custom OrderProcess extend an already existing one, or should I create a whole new state in the order-state-machine? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi, It sounds like you can keep the existing default OrderProcess but then add your own in addition, which defines the new "Checking" state. In this new custom process you can override the state transition rules so that the order must proceed from |
Beta Was this translation helpful? Give feedback.
Hi,
It sounds like you can keep the existing default OrderProcess but then add your own in addition, which defines the new "Checking" state.
In this new custom process you can override the state transition rules so that the order must proceed from
AddingItems -> Checking -> ArrangingPayment
, like in the example given here: https://beta-docs.vendure.io/guides/core-concepts/orders/#adding-a-new-state