Skip to content

Commit 51a8378

Browse files
committed
MC-29444: Extra Values of UPS and USPS are in dropdown list Cart Price Rule - Condition - Shipping Method
1 parent 21254bf commit 51a8378

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

app/code/Magento/Ups/Model/Carrier.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,13 +1320,11 @@ public function getAllowedMethods()
13201320
? $this->configHelper->getCode('originShipment', $origin)
13211321
: $this->configHelper->getCode('method');
13221322

1323-
$filteredMethods = array_filter($availableByTypeMethods, function ($methodCode) use ($allowedMethods) {
1324-
return in_array($methodCode, $allowedMethods);
1325-
}, ARRAY_FILTER_USE_KEY);
1326-
13271323
$methods = [];
1328-
foreach ($filteredMethods as $methodCode => $methodData) {
1329-
$methods[$methodCode] = $methodData->getText();
1324+
foreach ($availableByTypeMethods as $methodCode => $methodData) {
1325+
if (in_array($methodCode, $allowedMethods)) {
1326+
$methods[$methodCode] = $methodData->getText();
1327+
}
13301328
}
13311329

13321330
return $methods;

0 commit comments

Comments
 (0)