Magento upgrade services are essential if you own a Magento store. Upgrade to the latest version of Magento 2 and create seamless shopping experiences to your customers.
In Magento, defining an appropriate Order Status provides a clear idea for the operations team to understand the position of the order and take the necessary action. Magento has an Order State and Order Status that describes the current position of the order. The Default Order State and the corresponding statuses available in Magento are:
[table id=6 /]
Each Order State can be associated with different kinds of Order Statuses to provide a clear picture about the order. While Magento provides an option to customize the Order Status, the Order State still has the default options. In few occasions, retailers look out for a customized Order State so that there is no miscommunication across different verticals in the organization.
We are planning to add a new Order State called “Partially paid”. Let’s have a look at the method to create a customized Order State in Magento.
First we need register the new module in Magento. To accomplish this, create a new xml file in this path. app/etc/modules/Custom_Orderstate.xml
Next, we need to configure our module. The configuration files can be found in the “etc” folder inside our module directory. So let’s create the configuration xml file: app/code/local/Custom/Orderstate/etc/config.xml
Once the configuration is done, we need to create a SQL script file to insert our order state on the database tables (sales_order_status & sales_order_status_state). Let’s create a new PHP file in the following folder:
getTable('sales/order_status'); $statusStateTable = $installer->getTable('sales/order_status_state'); // Insert statuses $installer->getConnection()->insertArray( $statusTable, array('status', 'label'), array( array( 'status' => 'partial_paid', 'label' => 'Partial Paid' ) ) ); // Insert states and mapping of statuses to states $installer->getConnection()->insertArray( $statusStateTable, array('status', 'state', 'is_default'), array( array( 'status' => 'partial_paid', 'state' => 'partial_paid', 'is_default' => 1 ) ) );
The final step is to login your Magento admin side. You can see the newly created order state ‘Partial Paid’ under the System > Order Statuses path.
With changing market dynamic retailers, look out for methods to improve the operational efficiency by providing an appropriate order state. This will allow a clear flow of communication across different departments in the organization enabling retailers to avoid confusions and increase productivity.