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.
- Specify the
displayvalue of the necessary state, as you want it on the Storefront. In the following example, the
displayvalue of the
confirmedOMS sate is set 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>
You can have the same display values for different OMS states.
- In Back Office, go to Administration > Glossary.
- In the LIST OF TRANSLATIONS table, in the NAME column, find the state name as you specified for the
waiting for shipment.
- Provide the new glossary keys, that is, translations of the state:
- In the ACTIONS column, click Edit. The Edit Translation page opens.
- For the available locales, enter translations and click Save. The Overview of Translation page opens, where you can see the translations of the order state for the Storefront.
On the Storefront, on the Order Overview and Order History pages, customers can 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, the one specified in the
state name parameter, is displayed on the Storefront.
For submitting the form