Skip to content

Commit

Permalink
Merge pull request #3794 from craftcms/feature/pt-2328-5x-product-nam…
Browse files Browse the repository at this point in the history
…e-of-a-line-item-isnt-clickable-in-cp

Purchasable line items missing their CP edit URL on order edit
  • Loading branch information
nfourtythree authored Dec 4, 2024
2 parents cd2a61a + c37e169 commit 0db1d2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Fixed a bug where purchasable line items were missing their CP edit URL on the Edit Order page. ([#3792](https://github.com/craftcms/commerce/issues/3792))
- Fixed a bug where draft purchasables would show up on the Inventory page.
- Fixed a PHP error that could occur when creating inventory transfers. ([#3696](https://github.com/craftcms/commerce/issues/3696))
- Fixed a bug where the price was not formatted correctly according to the locale in the payment model on the Order Edit screens. ([#3789](https://github.com/craftcms/commerce/issues/3789))
Expand Down
8 changes: 8 additions & 0 deletions src/elements/Variant.php
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,14 @@ public function canView(User $user): bool
return $product->canView($user);
}

/**
* @inheritdoc
*/
public function getCpEditUrl(): ?string
{
return $this->getOwner() ? $this->getOwner()->getCpEditUrl() : null;
}

/**
* @inheritdoc
*/
Expand Down

0 comments on commit 0db1d2f

Please sign in to comment.