From 1f32c70e0e791511b89f217a51c014e625513658 Mon Sep 17 00:00:00 2001 From: ragnese Date: Tue, 28 May 2024 18:17:31 -0400 Subject: [PATCH] Fixed erroneous call to getText() method in Mage_Usa_Model_Shipping_Carrier_Ups::getAllowedMethods() (#4013) Co-authored-by: Fabrizio Balliano --- app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php index 14312d7f02d..6088cf673dd 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php @@ -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; } }