Skip to content

Commit e895838

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #20866: [Backport] Issue #20380 fixed for 2.2 (by @maheshWebkul721) Fixed GitHub Issues: - #20380: Get Shipping Method as object from order instance gives undefined index. (reported by @maheshWebkul721) has been fixed in #20866 by @maheshWebkul721 in 2.2-develop branch Related commits: 1. c495f31
2 parents 7078f61 + fb26894 commit e895838

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/code/Magento/Sales/Model/Order.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,12 +1298,12 @@ public function getTrackingNumbers()
12981298
* Retrieve shipping method
12991299
*
13001300
* @param bool $asObject return carrier code and shipping method data as object
1301-
* @return string|\Magento\Framework\DataObject
1301+
* @return string|null|\Magento\Framework\DataObject
13021302
*/
13031303
public function getShippingMethod($asObject = false)
13041304
{
13051305
$shippingMethod = parent::getShippingMethod();
1306-
if (!$asObject) {
1306+
if (!$asObject || !$shippingMethod) {
13071307
return $shippingMethod;
13081308
} else {
13091309
list($carrierCode, $method) = explode('_', $shippingMethod, 2);

0 commit comments

Comments
 (0)