-
Notifications
You must be signed in to change notification settings - Fork 254
Avoid querying inventory default stock view in storefront operations #2350
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
Conversation
|
Looking for a maintainer to review. |
| $select->from( | ||
| $stockItemTableName, | ||
| [ | ||
| GetStockItemDataInterface::QUANTITY => 'qty', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constants may be used
\Magento\CatalogInventory\Api\Data\StockStatusInterface::QTY
\Magento\CatalogInventory\Api\Data\StockStatusInterface::STOCK_STATUS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solution requires adding a dependency on the CatalogInventory this should be done in a centralized way, so filed a separate ticket for it.
#2387
| GetStockItemDataInterface::QUANTITY => 'qty', | ||
| GetStockItemDataInterface::IS_SALABLE => 'stock_status', | ||
| ] | ||
| )->where('product_id' . ' = ?', $productId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not see sense to join both stings when you can directly use joined string.
Avoid querying inventory default stock view in storefront operations
Description (*)
This Pull Request is supposed to reduce the usage of
inventory_stock_1database view in frontend operations.Contribution checklist (*)