Mandatory order fields in Craft Commerce 2 Ist it possible to add validation rules for Carts/Orders? I need to check whether there is at least one list item added to the cart before payment is initiated.

Unlike addresses (Address::EVENT_REGISTER_ADDRESS_VALIDATION_RULES) there seems not to be an event for manipulating rules.

I’d prefer a server-side solution.
There is a setting for this specific instance allowEmptyCartOnCheckout.

Creating a commerce.php file in the config directory with the following code will prevent customers from checkout out with an empty cart.

&lt;?php

return [
  'allowEmptyCartOnCheckout' =&gt; false
];