From 2a371bd8b5567c0c4025340ee59fec84ce7d1aba Mon Sep 17 00:00:00 2001 From: micwallace Date: Fri, 11 Oct 2019 02:05:31 +0000 Subject: [PATCH 1/2] Provide service name in getAllowedMethods function Carrier name is currently provided as the value for every service in the getAllowedMethods function. This patch corrects this so that the service name is returned instead. --- Model/Shipping/Carrier/AustraliaPost.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model/Shipping/Carrier/AustraliaPost.php b/Model/Shipping/Carrier/AustraliaPost.php index 2f8e656..d23d094 100644 --- a/Model/Shipping/Carrier/AustraliaPost.php +++ b/Model/Shipping/Carrier/AustraliaPost.php @@ -517,7 +517,7 @@ public function getAllowedMethods() $formatMethods = array(); foreach ($methods as $method) { - $formatMethods[$method] = $this->getConfigData('title'); + $formatMethods[$method] = $this->getCode('services', $method); } return $formatMethods; From b9f72534006d8fb304f718ad138d1e4d8cf7d6b1 Mon Sep 17 00:00:00 2001 From: micwallace Date: Fri, 8 Nov 2019 12:05:15 +1100 Subject: [PATCH 2/2] Added fallback for method name Fallback to method code when method name isn't found in the config. --- Model/Shipping/Carrier/AustraliaPost.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model/Shipping/Carrier/AustraliaPost.php b/Model/Shipping/Carrier/AustraliaPost.php index d23d094..1c11de8 100644 --- a/Model/Shipping/Carrier/AustraliaPost.php +++ b/Model/Shipping/Carrier/AustraliaPost.php @@ -517,7 +517,7 @@ public function getAllowedMethods() $formatMethods = array(); foreach ($methods as $method) { - $formatMethods[$method] = $this->getCode('services', $method); + $formatMethods[$method] = $this->getCode('services', $method) ?? "Unknown (" . $method . ")"; } return $formatMethods;