Skip to content

Commit 47e2962

Browse files
anzinandrewbess
authored andcommitted
Fixed Carrier asort() function
1 parent 552c81f commit 47e2962

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/code/Magento/Usps/Model/Carrier.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,9 @@ protected function _parseXmlResponse($response)
634634
);
635635
}
636636
}
637-
asort($priceArr);
637+
uasort($priceArr, function($previous, $next){
638+
return ($previous <= $next) ? -1 : 1;
639+
});
638640
} elseif (!$isUS && is_object($xml->Package->Service)) {
639641
/*
640642
* International Rates
@@ -654,7 +656,9 @@ protected function _parseXmlResponse($response)
654656
);
655657
}
656658
}
657-
asort($priceArr);
659+
uasort($priceArr, function($previous, $next){
660+
return ($previous <= $next) ? -1 : 1;
661+
});
658662
}
659663
}
660664
}

0 commit comments

Comments
 (0)