Skip to content

Conversation

@ishakhsuvarov
Copy link
Contributor

Description (*)

This Pull Request is supposed to reduce the usage of inventory_stock_1 database view in frontend operations.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@ishakhsuvarov
Copy link
Contributor Author

Looking for a maintainer to review.

$select->from(
$stockItemTableName,
[
GetStockItemDataInterface::QUANTITY => 'qty',
Copy link
Contributor

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

Copy link
Contributor Author

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);
Copy link
Contributor

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.

@ishakhsuvarov ishakhsuvarov merged commit d013cb0 into 2.3-develop Jul 8, 2019
@ishakhsuvarov ishakhsuvarov deleted the avoid-view-query-on-default-stock branch August 21, 2019 19:46
@ishakhsuvarov ishakhsuvarov added this to the 1.1.3 milestone Oct 1, 2019
ishakhsuvarov added a commit that referenced this pull request Nov 22, 2019
Avoid querying inventory default stock view in storefront operations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants