Skip to content

Exception when trying to create an order manually in Craft admin #205

@SandraSundqvist

Description

@SandraSundqvist

Describe the bug

Hi!

I have a customer who occasionally needs to create orders manually in the Craft admin. However, when they try to add a line item the error: “Couldn’t recalculate order.” appears.

In the logs we get:

TypeError: craft\commerce\models\LineItem::setPrice(): Argument #1 ($price) must be of type int|float, null given, called in /var/www/html/vendor/craftcms/commerce/src/models/LineItem.php on line 920 and defined in /var/www/html/vendor/craftcms/commerce/src/models/LineItem.php:480

When adding the line items, the price is always displayed as 0.00, even though each item has a valid price. I suspect this is related to the issue.

Image

Steps to reproduce

  1. Create a manual order in Craft commerce
  2. Select a line item
  3. Hit "Add"
  4. Error happens

Craft CMS version

Craft Pro 5.8.22

Plugin version

3.0.14

Multi-site?

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions