Skip to content

Commit 68a02ca

Browse files
🔃 [EngCom] Public Pull Requests - 2.3-develop Minor Fixes
Accepted Public Pull Requests: - #20428: checkout-page-shipping-title::Shipping method title overlapping on ed… (by @yashwant2jcommerce) - #20469: Fixed-Product-page-tabbing-content-misalignment-in-mobile-view :: Pro… (by @parag2jcommerce) - #20581: Time-fields-misaligned-in-iPad-landscape-view ::Time fields misaligne… (by @ajay2jcommerce) - #20725: My-account-page-title-extra-space-on-mobile (by @amol2jcommerce) - #20759: Code Cleanup : Typo Fixed enabed -> enabled (by @satyaprakashpatel) - #20634: Fixed Issue #20631 Console error on checkout after changing the allowed countries from admin (by @GovindaSharma) - #20653: Fix typehint (by @shochdoerfer) - #20628: Assign with and, or, replaced by &&, || (by @lfluvisotto) - #20488: tooltip-dropdown-pointer :: Tooltip dropdown pointer not proper on ta� (by @ranee2jcommerce) - #19182: #14849: [Forwardport] In Sales Emails no translation using order.getStatusLabel(). (by @p-bystritsky) Fixed GitHub Issues: - #20427: Shipping method title overlapping on edit icon in mobile view on Checkout page (reported by @faizan2jcommerce) has been fixed in #20428 by @yashwant2jcommerce in 2.3-develop branch Related commits: 1. a1db46b - #20468: On Product Page Tabings Content Misaligned on Mobile View (reported by @parag2jcommerce) has been fixed in #20469 by @parag2jcommerce in 2.3-develop branch Related commits: 1. c33a84d - #20580: Time fields misaligned in iPad landscape view (1024 x 768) (reported by @yashwant2jcommerce) has been fixed in #20581 by @ajay2jcommerce in 2.3-develop branch Related commits: 1. fce9a9d - #20723: My account page title extra space on mobile (when not display error or success messages) (reported by @priti2jcommerce) has been fixed in #20725 by @amol2jcommerce in 2.3-develop branch Related commits: 1. ac39ca2 2. 89ece35 3. fe35a75 4. 5e2ac52 5. b208e44 - #20631: Console error on checkout after changing the allowed countries from admin. (reported by @maheshWebkul721) has been fixed in #20634 by @GovindaSharma in 2.3-develop branch Related commits: 1. 12deeeb 2. d134032 3. 0902931 - #20487: On checkout page tooltip dropdown pointer not proper on tablet (reported by @ranee2jcommerce) has been fixed in #20488 by @ranee2jcommerce in 2.3-develop branch Related commits: 1. 547b80b 2. 3b63526 - #14849: In Sales Emails no translation using order.getStatusLabel() (reported by @raymond62) has been fixed in #19182 by @p-bystritsky in 2.3-develop branch Related commits: 1. bbf1247 2. 3998176 3. 2bc10a2 4. 149d9e1
2 parents fd25d85 + 08a5ab0 commit 68a02ca

File tree

41 files changed

+228
-108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+228
-108
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ private function isUniqueAdminValues(array $optionsValues, array $deletedOptions
163163
{
164164
$adminValues = [];
165165
foreach ($optionsValues as $optionKey => $values) {
166-
if (!(isset($deletedOptions[$optionKey]) and $deletedOptions[$optionKey] === '1')) {
166+
if (!(isset($deletedOptions[$optionKey]) && $deletedOptions[$optionKey] === '1')) {
167167
$adminValues[] = reset($values);
168168
}
169169
}

app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<see userInput="Inserting a widget does not create a widget instance." stepKey="seeMessage" />
3737
<!--see Insert Widget button disabled-->
3838
<see selector="{{WidgetSection.InsertWidgetBtnDisabled}}" userInput="Insert Widget" stepKey="seeInsertWidgetDisabled" />
39-
<!--see Cancel button enabed-->
39+
<!--see Cancel button enabled-->
4040
<see selector="{{WidgetSection.CancelBtnEnabled}}" userInput="Cancel" stepKey="seeCancelBtnEnabled" />
4141
<!--Select "Widget Type"-->
4242
<selectOption selector="{{WidgetSection.WidgetType}}" userInput="CMS Page Link" stepKey="selectCMSPageLink" />

app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<see userInput="Inserting a widget does not create a widget instance." stepKey="seeMessage" />
4343
<!--see Insert Widget button disabled-->
4444
<see selector="{{WidgetSection.InsertWidgetBtnDisabled}}" userInput="Insert Widget" stepKey="seeInsertWidgetDisabled" />
45-
<!--see Cancel button enabed-->
45+
<!--see Cancel button enabled-->
4646
<see selector="{{WidgetSection.CancelBtnEnabled}}" userInput="Cancel" stepKey="seeCancelBtnEnabled" />
4747
<!--Select "Widget Type"-->
4848
<selectOption selector="{{WidgetSection.WidgetType}}" userInput="Catalog Products List" stepKey="selectCatalogProductsList" />

app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<waitForPageLoad stepKey="wait2"/>
4242
<!--see Insert Widget button disabled-->
4343
<see selector="{{WidgetSection.InsertWidgetBtnDisabled}}" userInput="Insert Widget" stepKey="seeInsertWidgetDisabled" />
44-
<!--see Cancel button enabed-->
44+
<!--see Cancel button enabled-->
4545
<see selector="{{WidgetSection.CancelBtnEnabled}}" userInput="Cancel" stepKey="seeCancelBtnEnabled" />
4646
<!--Select "Widget Type"-->
4747
<selectOption selector="{{WidgetSection.WidgetType}}" userInput="Recently Compared Products" stepKey="selectRecentlyComparedProducts" />

app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<see userInput="Inserting a widget does not create a widget instance." stepKey="seeMessage" />
4141
<!--see Insert Widget button disabled-->
4242
<see selector="{{WidgetSection.InsertWidgetBtnDisabled}}" userInput="Insert Widget" stepKey="seeInsertWidgetDisabled" />
43-
<!--see Cancel button enabed-->
43+
<!--see Cancel button enabled-->
4444
<see selector="{{WidgetSection.CancelBtnEnabled}}" userInput="Cancel" stepKey="seeCancelBtnEnabled" />
4545
<!--Select "Widget Type"-->
4646
<selectOption selector="{{WidgetSection.WidgetType}}" userInput="Recently Viewed Products" stepKey="selectRecentlyViewedProducts" />

app/code/Magento/Paypal/Controller/Transparent/RequestSecureToken.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function execute()
8383
/** @var Quote $quote */
8484
$quote = $this->sessionManager->getQuote();
8585

86-
if (!$quote or !$quote instanceof Quote) {
86+
if (!$quote || !$quote instanceof Quote) {
8787
return $this->getErrorResponse();
8888
}
8989

@@ -107,6 +107,8 @@ public function execute()
107107
}
108108

109109
/**
110+
* Get error response.
111+
*
110112
* @return Json
111113
*/
112114
private function getErrorResponse()

app/code/Magento/Quote/Model/Quote.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ public function getAllItems()
13991399
{
14001400
$items = [];
14011401
foreach ($this->getItemsCollection() as $item) {
1402-
/** @var \Magento\Quote\Model\ResourceModel\Quote\Item $item */
1402+
/** @var \Magento\Quote\Model\Quote\Item $item */
14031403
if (!$item->isDeleted()) {
14041404
$items[] = $item;
14051405
}

app/code/Magento/Sales/Model/Order.php

+18-6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Magento\Directory\Model\Currency;
99
use Magento\Framework\Api\AttributeValueFactory;
1010
use Magento\Framework\App\ObjectManager;
11+
use Magento\Framework\Exception\LocalizedException;
1112
use Magento\Framework\Locale\ResolverInterface;
1213
use Magento\Framework\Pricing\PriceCurrencyInterface;
1314
use Magento\Sales\Api\Data\OrderInterface;
@@ -1040,10 +1041,21 @@ public function setState($state)
10401041
return $this->setData(self::STATE, $state);
10411042
}
10421043

1044+
/**
1045+
* Retrieve frontend label of order status
1046+
*
1047+
* @return string
1048+
*/
1049+
public function getFrontendStatusLabel()
1050+
{
1051+
return $this->getConfig()->getStatusFrontendLabel($this->getStatus());
1052+
}
1053+
10431054
/**
10441055
* Retrieve label of order status
10451056
*
10461057
* @return string
1058+
* @throws LocalizedException
10471059
*/
10481060
public function getStatusLabel()
10491061
{
@@ -1151,12 +1163,12 @@ public function place()
11511163
* Hold order
11521164
*
11531165
* @return $this
1154-
* @throws \Magento\Framework\Exception\LocalizedException
1166+
* @throws LocalizedException
11551167
*/
11561168
public function hold()
11571169
{
11581170
if (!$this->canHold()) {
1159-
throw new \Magento\Framework\Exception\LocalizedException(__('A hold action is not available.'));
1171+
throw new LocalizedException(__('A hold action is not available.'));
11601172
}
11611173
$this->setHoldBeforeState($this->getState());
11621174
$this->setHoldBeforeStatus($this->getStatus());
@@ -1169,12 +1181,12 @@ public function hold()
11691181
* Attempt to unhold the order
11701182
*
11711183
* @return $this
1172-
* @throws \Magento\Framework\Exception\LocalizedException
1184+
* @throws LocalizedException
11731185
*/
11741186
public function unhold()
11751187
{
11761188
if (!$this->canUnhold()) {
1177-
throw new \Magento\Framework\Exception\LocalizedException(__('You cannot remove the hold.'));
1189+
throw new LocalizedException(__('You cannot remove the hold.'));
11781190
}
11791191

11801192
$this->setState($this->getHoldBeforeState())
@@ -1218,7 +1230,7 @@ public function isFraudDetected()
12181230
* @param string $comment
12191231
* @param bool $graceful
12201232
* @return $this
1221-
* @throws \Magento\Framework\Exception\LocalizedException
1233+
* @throws LocalizedException
12221234
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
12231235
*/
12241236
public function registerCancellation($comment = '', $graceful = true)
@@ -1257,7 +1269,7 @@ public function registerCancellation($comment = '', $graceful = true)
12571269
$this->addStatusHistoryComment($comment, false);
12581270
}
12591271
} elseif (!$graceful) {
1260-
throw new \Magento\Framework\Exception\LocalizedException(__('We cannot cancel this order.'));
1272+
throw new LocalizedException(__('We cannot cancel this order.'));
12611273
}
12621274
return $this;
12631275
}

app/code/Magento/Sales/Model/Order/Config.php

+42-11
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Sales\Model\Order;
77

8+
use Magento\Framework\Exception\LocalizedException;
9+
810
/**
911
* Order configuration model
1012
*
@@ -73,6 +75,8 @@ public function __construct(
7375
}
7476

7577
/**
78+
* Get collection.
79+
*
7680
* @return \Magento\Sales\Model\ResourceModel\Order\Status\Collection
7781
*/
7882
protected function _getCollection()
@@ -84,8 +88,10 @@ protected function _getCollection()
8488
}
8589

8690
/**
91+
* Get state.
92+
*
8793
* @param string $state
88-
* @return Status|null
94+
* @return Status
8995
*/
9096
protected function _getState($state)
9197
{
@@ -101,9 +107,9 @@ protected function _getState($state)
101107
* Retrieve default status for state
102108
*
103109
* @param string $state
104-
* @return string
110+
* @return string|null
105111
*/
106-
public function getStateDefaultStatus($state)
112+
public function getStateDefaultStatus($state): ?string
107113
{
108114
$status = false;
109115
$stateNode = $this->_getState($state);
@@ -115,24 +121,48 @@ public function getStateDefaultStatus($state)
115121
}
116122

117123
/**
118-
* Retrieve status label
124+
* Get status label for a specified area
119125
*
120-
* @param string $code
121-
* @return string
126+
* @param string|null $code
127+
* @param string $area
128+
* @return string|null
122129
*/
123-
public function getStatusLabel($code)
130+
private function getStatusLabelForArea(?string $code, string $area): ?string
124131
{
125-
$area = $this->state->getAreaCode();
126132
$code = $this->maskStatusForArea($area, $code);
127133
$status = $this->orderStatusFactory->create()->load($code);
128134

129-
if ($area == 'adminhtml') {
135+
if ($area === 'adminhtml') {
130136
return $status->getLabel();
131137
}
132138

133139
return $status->getStoreLabel();
134140
}
135141

142+
/**
143+
* Retrieve status label for detected area
144+
*
145+
* @param string|null $code
146+
* @return string|null
147+
* @throws LocalizedException
148+
*/
149+
public function getStatusLabel($code)
150+
{
151+
$area = $this->state->getAreaCode() ?: \Magento\Framework\App\Area::AREA_FRONTEND;
152+
return $this->getStatusLabelForArea($code, $area);
153+
}
154+
155+
/**
156+
* Retrieve status label for area
157+
*
158+
* @param string|null $code
159+
* @return string|null
160+
*/
161+
public function getStatusFrontendLabel(?string $code): ?string
162+
{
163+
return $this->getStatusLabelForArea($code, \Magento\Framework\App\Area::AREA_FRONTEND);
164+
}
165+
136166
/**
137167
* Mask status for order for specified area
138168
*
@@ -249,8 +279,9 @@ public function getInvisibleOnFrontStatuses()
249279
}
250280

251281
/**
252-
* Get existing order statuses
253-
* Visible or invisible on frontend according to passed param
282+
* Get existing order statuses.
283+
*
284+
* Visible or invisible on frontend according to passed param.
254285
*
255286
* @param bool $visibility
256287
* @return array

app/code/Magento/Sales/view/frontend/email/creditmemo_update.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"var this.getUrl($store, 'customer/account/')":"Customer Account URL",
1212
"var order.getCustomerName()":"Customer Name",
1313
"var order.increment_id":"Order Id",
14-
"var order.getStatusLabel()":"Order Status"
14+
"var order.getFrontendStatusLabel()":"Order Status"
1515
} @-->
1616
{{template config_path="design/email/header_template"}}
1717

@@ -24,7 +24,7 @@
2424
"Your order #%increment_id has been updated with a status of <strong>%order_status</strong>."
2525

2626
increment_id=$order.increment_id
27-
order_status=$order.getStatusLabel()
27+
order_status=$order.getFrontendStatusLabel()
2828
|raw}}
2929
</p>
3030
<p>{{trans 'You can check the status of your order by <a href="%account_url">logging into your account</a>.' account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}}</p>

app/code/Magento/Sales/view/frontend/email/creditmemo_update_guest.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"var creditmemo.increment_id":"Credit Memo Id",
1111
"var billing.getName()":"Guest Customer Name",
1212
"var order.increment_id":"Order Id",
13-
"var order.getStatusLabel()":"Order Status"
13+
"var order.getFrontendStatusLabel()":"Order Status"
1414
} @-->
1515
{{template config_path="design/email/header_template"}}
1616

@@ -23,7 +23,7 @@
2323
"Your order #%increment_id has been updated with a status of <strong>%order_status</strong>."
2424

2525
increment_id=$order.increment_id
26-
order_status=$order.getStatusLabel()
26+
order_status=$order.getFrontendStatusLabel()
2727
|raw}}
2828
</p>
2929
<p>

app/code/Magento/Sales/view/frontend/email/invoice_update.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"var comment":"Invoice Comment",
1212
"var invoice.increment_id":"Invoice Id",
1313
"var order.increment_id":"Order Id",
14-
"var order.getStatusLabel()":"Order Status"
14+
"var order.getFrontendStatusLabel()":"Order Status"
1515
} @-->
1616
{{template config_path="design/email/header_template"}}
1717

@@ -24,7 +24,7 @@
2424
"Your order #%increment_id has been updated with a status of <strong>%order_status</strong>."
2525

2626
increment_id=$order.increment_id
27-
order_status=$order.getStatusLabel()
27+
order_status=$order.getFrontendStatusLabel()
2828
|raw}}
2929
</p>
3030
<p>{{trans 'You can check the status of your order by <a href="%account_url">logging into your account</a>.' account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}}</p>

app/code/Magento/Sales/view/frontend/email/invoice_update_guest.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"var comment":"Invoice Comment",
1111
"var invoice.increment_id":"Invoice Id",
1212
"var order.increment_id":"Order Id",
13-
"var order.getStatusLabel()":"Order Status"
13+
"var order.getFrontendStatusLabel()":"Order Status"
1414
} @-->
1515
{{template config_path="design/email/header_template"}}
1616

@@ -23,7 +23,7 @@
2323
"Your order #%increment_id has been updated with a status of <strong>%order_status</strong>."
2424

2525
increment_id=$order.increment_id
26-
order_status=$order.getStatusLabel()
26+
order_status=$order.getFrontendStatusLabel()
2727
|raw}}
2828
</p>
2929
<p>

app/code/Magento/Sales/view/frontend/email/order_update.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"var order.getCustomerName()":"Customer Name",
1111
"var comment":"Order Comment",
1212
"var order.increment_id":"Order Id",
13-
"var order.getStatusLabel()":"Order Status"
13+
"var order.getFrontendStatusLabel()":"Order Status"
1414
} @-->
1515
{{template config_path="design/email/header_template"}}
1616

@@ -23,7 +23,7 @@
2323
"Your order #%increment_id has been updated with a status of <strong>%order_status</strong>."
2424

2525
increment_id=$order.increment_id
26-
order_status=$order.getStatusLabel()
26+
order_status=$order.getFrontendStatusLabel()
2727
|raw}}
2828
</p>
2929
<p>{{trans 'You can check the status of your order by <a href="%account_url">logging into your account</a>.' account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}}</p>

app/code/Magento/Sales/view/frontend/email/order_update_guest.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"var billing.getName()":"Guest Customer Name",
1010
"var comment":"Order Comment",
1111
"var order.increment_id":"Order Id",
12-
"var order.getStatusLabel()":"Order Status"
12+
"var order.getFrontendStatusLabel()":"Order Status"
1313
} @-->
1414
{{template config_path="design/email/header_template"}}
1515

@@ -22,7 +22,7 @@
2222
"Your order #%increment_id has been updated with a status of <strong>%order_status</strong>."
2323

2424
increment_id=$order.increment_id
25-
order_status=$order.getStatusLabel()
25+
order_status=$order.getFrontendStatusLabel()
2626
|raw}}
2727
</p>
2828
<p>

app/code/Magento/Sales/view/frontend/email/shipment_update.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"var order.getCustomerName()":"Customer Name",
1111
"var comment":"Order Comment",
1212
"var order.increment_id":"Order Id",
13-
"var order.getStatusLabel()":"Order Status",
13+
"var order.getFrontendStatusLabel()":"Order Status",
1414
"var shipment.increment_id":"Shipment Id"
1515
} @-->
1616
{{template config_path="design/email/header_template"}}
@@ -24,7 +24,7 @@
2424
"Your order #%increment_id has been updated with a status of <strong>%order_status</strong>."
2525

2626
increment_id=$order.increment_id
27-
order_status=$order.getStatusLabel()
27+
order_status=$order.getFrontendStatusLabel()
2828
|raw}}
2929
</p>
3030
<p>{{trans 'You can check the status of your order by <a href="%account_url">logging into your account</a>.' account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}}</p>

0 commit comments

Comments
 (0)