A Guide to Automate the Transition of a Commerce Order
ComputerMinds has published a new article on an important issue for e-commerce sites based on Drupal. The article is authored by an experienced developer, Ross Bale. Ross puts forth a step-by-step guide that helps a developer to get a commerce order to transition to an ‘exported’ state automatically after it’s been paid for.
An Exportable order is a common requirement for any website that sells products. It means the orders placed on the website are made available as a transferable file. It helps the order be sent to a different system for processing.
The Drupal Commerce 2.x module (for Drupal 9, 10) has a similar concept in place. It comes with the order ‘Workflows’ and defined ‘States’ and ‘Transitions.’ A workflow is a set of states and transitions the order will go through during its lifecycle. When transitions are applied to an order, it will take the order from one state to another.
A few workflows are provided for the sites by default. Developers usually have to build their workflows to address the specific needs of each site. More details about creating a custom workflow can be found in the documentation published on drupalcommerce.org.
The default workflow does not have the ability to automatically transition to a separate state once the payment is made. Ross’ article takes us through the steps to achieve this functionality.
