HowTo - Display custom names for order item states on the StorefrontEdit on GitHub
For the order items states on the Storefront, it is not always appropriate to display the states as they are in the state machine, as they do not make much sense for Buyers. For example, for the OMS confirmed state, you might want to display this sate as, for example, waiting for shipment for the Storefront users.
To display custom order states on the Storefront, do the following:
In your project, go to
/config/Zed/omsand open the .XML file of the payment method or sub-process you want to change the order states on the Storefront for. For example, let’s take the default Spryker DummyPayment01.xml.
displayvalue of the necessary state, as you want it on the Storefront. In the example below, we have set the
displayvalue of the confirmed OMS sate to waiting for shipment:
?xml version="1.0"?> <statemachine xmlns="spryker:oms-01" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="spryker:oms-01 http://static.spryker.com/oms-01.xsd"> <process name="DummyPayment01" main="true"> <subprocesses> <process>DummyRefund</process> <process>DummyReturn</process> <process>DummyInvoice</process> <process>CreateGiftCard</process> </subprocesses> <states> ... <state name="confirmed" reserved="true" display="waiting for shipment"> <flag>cancellable</flag> </state>
It is possible to have the same display values for different OMS states.
Go to Back Office > Glossary.
In the List of translations table, the Name column, find the state name as you specified it for the
displayparameter. For our example, it is waiting for shipment.
Provide the new glossary keys, that is, translations of the state:
- Click Edit in the Actions column. You are taken to the Edit translation page.
- Enter translations for the available locales and click Save. You are taken to the Overview of Translation page where you can see the translations of the order state for the Storefront.
That’s it! Now, on the Order Overview and Order History pages on the Storefront, customers see the states that correspond to the values of the
display parameter you set in .XML files of the respective payment methods and sub-processes.
If you delete the
display parameter with its value, the OMS state, that is, the one specified in the
state name parameter, is displayed on the Storefront.
For submitting the form