inventory
inventory copied to clipboard
Load product salability data on-demand
Can and must be delivered together with #3243: Product Salability Improvements branch
Summary (*)
Product salability data should not be loaded every time on product load, on-demand only.
See \Magento\CatalogInventory\Observer\AddInventoryDataObserver.
Examples (*)
- Current behavior can lead to performance degradation;
- It is required change to resolve #3200: Composite products support for IsProductSaleable
Proposed solution
- Disable
\Magento\CatalogInventory\Observer\AddInventoryDataObserver - Remove
\Magento\InventoryBundleProduct\Plugin\CatalogInventory\Helper\Stock\AdaptAssignStatusToProductPlugin - Remove
\Magento\InventoryConfigurableProduct\Plugin\CatalogInventory\Helper\Stock\AdaptAssignStatusToProductPlugin - Remove
\Magento\InventoryCatalog\Plugin\CatalogInventory\Helper\Stock\AdaptAssignStatusToProductPlugin - Call
AreProductsSalableservice in a plugin on$product->isAvailable()method in order to preserve current logic. See #3039 Async Salable Status, it is partially implemented there, so some commits should be cherry-picked.
Hi @novikor. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.
Please, add a comment to assign the issue: @magento I am working on this
- Join Magento Community Engineering Slack and ask your questions in #github channel.