Skip to content

Commit

Permalink
Merge pull request #3841 from boboldehampsink/improve-shipping-method…
Browse files Browse the repository at this point in the history
…s-performance

Improve shipping methods performance
  • Loading branch information
lukeholder authored Jan 21, 2025
2 parents d8d05ca + 9a5c24e commit aad0a17
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/services/ShippingMethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,10 @@ public function getMatchingShippingMethods(Order $order): array

/** @var ShippingMethod $method */
foreach ($event->shippingMethods as $method) {
$totalPrice = $method->getPriceForOrder($order);

if ($method->getIsEnabled() && $method->matchOrder($order)) {
$matchingMethods[$method->getHandle()] = [
'method' => $method,
'price' => $totalPrice, // Store the price so we can sort on it before returning
'price' => $method->getPriceForOrder($order), // Store the price so we can sort on it before returning
];
}
}
Expand Down

0 comments on commit aad0a17

Please sign in to comment.