Skip to content

Commit

Permalink
Merge branch 'OpenMage:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichel authored May 28, 2024
2 parents 10a44ec + 1f32c70 commit 28bbb75
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php
Original file line number Diff line number Diff line change
Expand Up @@ -1330,18 +1330,12 @@ public function getResponse()
public function getAllowedMethods()
{
$allowedMethods = explode(',', (string)$this->getConfigData('allowed_methods'));
$isUpsXml = $this->getConfigData('type') === 'UPS_XML';
$isUpsRest = $this->getConfigData('type') === 'UPS_REST';
$origin = $this->getConfigData('origin_shipment');

$availableByTypeMethods = ($isUpsXml || $isUpsRest)
? $this->getCode('originShipment', $origin)
: $this->getCode('method');
$availableByTypeMethods = $this->getCode('originShipment', $this->getConfigData('origin_shipment'));

$methods = [];
foreach ($availableByTypeMethods as $methodCode => $methodData) {
if (in_array($methodCode, $allowedMethods)) {
$methods[$methodCode] = $methodData->getText();
$methods[$methodCode] = $methodData;
}
}

Expand Down

0 comments on commit 28bbb75

Please sign in to comment.