Load product salability data on-demand
- Dominant language
- PHP
- Stars
- 357
- Forks
- 262
- PR merge metrics
- No merged PRs in 30d
Description
**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` ](https://github.com/magento/inventory/blob/1.2-develop/InventoryBundleProduct/Plugin/CatalogInventory/Helper/Stock/AdaptAssignStatusToProductPlugin.php)
- Remove [`\Magento\InventoryConfigurableProduct\Plugin\CatalogInventory\Helper\Stock\AdaptAssignStatusToProductPlugin`](https://github.com/magento/inventory/blob/1.2-develop/InventoryConfigurableProduct/Plugin/CatalogInventory/Helper/Stock/AdaptAssignStatusToProductPlugin.php)
- Remove [`\Magento\InventoryCatalog\Plugin\CatalogInventory\Helper\Stock\AdaptAssignStatusToProductPlugin`](https://github.com/magento/inventory/blob/1.2-develop/InventoryCatalog/Plugin/CatalogInventory/Helper/Stock/AdaptAssignStatusToProductPlugin.php)
- Call `AreProductsSalable` service 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.