Skip to content

sales_order_item_save_commit_after and sales_order_save_commit_after events will never fire for guest checkout #19034

Closed
@swnsma

Description

@swnsma

Preconditions

1.Magento version: 2.2.6
2. PHP 7.1.x
3. Completely clean install with no demo data

Steps to reproduce

  1. Create new observers for events sales_order_item_save_commit_after and sales_order_save_commit_after.
  2. Complete checkout as guest user.

Expected result

  1. Events have fired.
  2. Observers have processed events.

Actual result

  1. Events have not fired.

Additional information

For guest checkout there are two additional transactions open in 'GuestPaymentInformationManagement'.
image
These transactions lead to fact that transaction level will never be set less than '2' and after commit callback will not be processed.
image

Possible fix

Transactions were opened to solve issue with QTY concurrency while order is placing (concurrent order placement could lead to negative stock value).
So, possible, issue could be fixed by moving \Magento\CatalogInventory\Observer\SubtractQuoteInventoryObserver to Sales Order Save transaction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Format is validGate 1 Passed. Automatic verification of issue format passed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions