File tree 2 files changed +27
-7
lines changed
app/code/Magento/Sales/Model 2 files changed +27
-7
lines changed Original file line number Diff line number Diff line change @@ -982,11 +982,10 @@ public function setState($state)
982
982
* Retrieve frontend label of order status
983
983
*
984
984
* @return string
985
- * @throws LocalizedException
986
985
*/
987
986
public function getFrontendStatusLabel ()
988
987
{
989
- return $ this ->getConfig ()->getStatusLabel ($ this ->getStatus (), \ Magento \ Framework \ App \Area:: AREA_FRONTEND );
988
+ return $ this ->getConfig ()->getStatusFrontendLabel ($ this ->getStatus ());
990
989
}
991
990
992
991
/**
Original file line number Diff line number Diff line change @@ -117,16 +117,14 @@ public function getStateDefaultStatus($state)
117
117
}
118
118
119
119
/**
120
- * Retrieve status label
120
+ * Get status label for a specified area
121
121
*
122
122
* @param string $code
123
- * @param string|null $forceArea
123
+ * @param string $area
124
124
* @return string
125
- * @throws LocalizedException
126
125
*/
127
- public function getStatusLabel ( $ code , $ forceArea = null )
126
+ private function getStatusLabelForArea ( string $ code , string $ area ): string
128
127
{
129
- $ area = $ forceArea ?: $ this ->state ->getAreaCode ();
130
128
$ code = $ this ->maskStatusForArea ($ area , $ code );
131
129
$ status = $ this ->orderStatusFactory ->create ()->load ($ code );
132
130
@@ -137,6 +135,29 @@ public function getStatusLabel($code, $forceArea = null)
137
135
return $ status ->getStoreLabel ();
138
136
}
139
137
138
+ /**
139
+ * Retrieve status label for detected area
140
+ *
141
+ * @param string $code
142
+ * @return string
143
+ * @throws LocalizedException
144
+ */
145
+ public function getStatusLabel ($ code )
146
+ {
147
+ return $ this ->getStatusLabelForArea ($ code , $ this ->state ->getAreaCode ());
148
+ }
149
+
150
+ /**
151
+ * Retrieve status label for area
152
+ *
153
+ * @param string $code
154
+ * @return string
155
+ */
156
+ public function getStatusFrontendLabel (string $ code ): string
157
+ {
158
+ return $ this ->getStatusLabelForArea ($ code , \Magento \Framework \App \Area::AREA_FRONTEND );
159
+ }
160
+
140
161
/**
141
162
* Mask status for order for specified area
142
163
*
You can’t perform that action at this time.
0 commit comments