Skip to content

Commit

Permalink
Fixed erroneous call to getText() method in Mage_Usa_Model_Shipping_C…
Browse files Browse the repository at this point in the history
…arrier_Ups::getAllowedMethods() (#4013)

Co-authored-by: Fabrizio Balliano <[email protected]>
  • Loading branch information
ragnese and fballiano authored May 28, 2024
1 parent 1b86733 commit 1f32c70
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 1f32c70

Please sign in to comment.