-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inventory Reserveration order_placed #3392
Comments
Hi @pmathbliss. Thank you for your report. Join Magento Community Engineering Slack and ask your questions in #github channel. |
Same issue here: When try to run this command:
this error happend:
In de inventory_reservation table, I have missing object_id of some reservations: This error causes some products in frotend to appear when they shouldn't at price 0: |
Hi @okolesnyk. Thank you for your request. I'm working on Magento instance for you. |
Hi @okolesnyk, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later. |
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
The object_id is populated in inventory_reservation.meta_key
{"event_type":"order_placed","object_type":"order","object_id":"14","object_increment_id":"000000022"}
I am currently on version 2.4.3 in my development but the object_id is missing on a 2.4.6. The idea is that populating this id would make the processing of the inventory reservations and cleaning up missing reservations much quicker. I also have a request the inventory reservation and testing quantity available is done in one transaction. I've attached the full log sql of creating test orders.
The above example was produced by moving the sale event to after the Proceed. $order = $proceed($order);
Here is my update to AppendReservationsAfterOrderPlacementPlugin:
\var\www\html\vendor\magento\module-inventory-sales\Plugin\Sales\OrderManagement\AppendReservationsAfterOrderPlacementPlugin.php
`public function aroundPlace(
OrderManagementInterface $subject,
callable $proceed,
OrderInterface $order
): OrderInterface {
$itemsById = $itemsBySku = $itemsToSell = [];
foreach ($order->getItems() as $item) {
if (!isset($itemsById[$item->getProductId()])) {
$itemsById[$item->getProductId()] = 0;
}
$itemsById[$item->getProductId()] += $item->getQtyOrdered();
}
$productSkus = $this->getSkusByProductIds->execute(array_keys($itemsById));
$productTypes = $this->getProductTypesBySkus->execute($productSkus);
}`
Actual result (*)
Magento 2 order placed.txt
The text was updated successfully, but these errors were encountered: