Skip to content

Commit

Permalink
Merge pull request #3734 from craftcms/feature/pt-2264-5x-completing-…
Browse files Browse the repository at this point in the history
…order-with-custom-line-item-throws-an-error

Fixed #3733 orders completing with custom line items
  • Loading branch information
nfourtythree authored Oct 21, 2024
2 parents a2d2eaa + edd24f5 commit e3a9a0d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- Fixed an SQL error that occurred when duplicating variants. ([#3727](https://github.com/craftcms/commerce/issues/3727))
- Fixed a PHP error that could occur when completing an order. ([#3733](https://github.com/craftcms/commerce/issues/3733))

## 5.2.0 - 2024-10-16

Expand Down
2 changes: 1 addition & 1 deletion src/services/LineItems.php
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ public function eagerLoadLineItemsForOrders(array $orders): array
public function orderCompleteHandler(LineItem $lineItem, Order $order): void
{
// Called the after order complete method for the purchasable if there is one
if ($lineItem->getPurchasable()) {
if ($lineItem->type === LineItemType::Purchasable && $lineItem->getPurchasable()) {
$lineItem->getPurchasable()->afterOrderComplete($order, $lineItem);
}

Expand Down

0 comments on commit e3a9a0d

Please sign in to comment.