Skip to content

Commit b769a1d

Browse files
committed
Fixed PHP error that could occur if someone hada. custom shipping method implmenting the ShippingMethodInterface
1 parent 6a11cef commit b769a1d

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release Notes for Craft Commerce
22

3+
## Unreleased
4+
5+
- Fixed a PHP error that could occur when registering a custom shipping method.
6+
37
## 4.8.2 - 2025-03-12
48

59
- Fixed a bug where line items’ sale prices could be calculated incorrectly. ([#3928](https://github.com/craftcms/commerce/issues/3928))

src/elements/Order.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1995,7 +1995,7 @@ public function getAvailableShippingMethodOptions(): array
19951995
{
19961996
// Matching will contain the core shipping methods and any plugin dynamically returned shipping methods.
19971997
$methods = Plugin::getInstance()->getShippingMethods()->getMatchingShippingMethods($this);
1998-
$matchingMethodHandles = ArrayHelper::getColumn($methods, 'handle');
1998+
$matchingMethodHandles = ArrayHelper::getColumn($methods, fn(ShippingMethodInterface $sm) => $sm->getHandle());
19991999

20002000
// Get all regular methods and add them to the list, for use only when the order is complete.
20012001
if ($this->isCompleted) {

0 commit comments

Comments
 (0)