inventory
inventory copied to clipboard
Out of stock products are not rendered with prices
Preconditions (*)
- Magento 2.3.5-p1 with magento/inventory-composer-metapackage version 1.1.5 (module-inventory, 1.0.8)
Steps to reproduce (*)
- Configurable products that are out of stock
- The setting "show out of stock products" = yes (config path "cataloginventory/options/show_out_of_stock")
Expected result (*)
That the products are visible and shown with price
Actual result (*)
- The products are visible but shown without price
It seems like there's a reversed logic bug in: https://github.com/magento/inventory/blob/1.1.5-p1/InventoryConfigurableProduct/Pricing/Price/LowestPriceOptionsProvider/StockStatusBaseSelectProcessor.php#L99 So the above is saying: If we SHOULD NOT show out of stock, do nothing. If we SHOULD show out of stock, ensure that the products returned are IN STOCK - as seen here: https://github.com/magento/inventory/blob/1.1.5-p1/InventoryConfigurableProduct/Pricing/Price/LowestPriceOptionsProvider/StockStatusBaseSelectProcessor.php#L133 . This is a complete reverse of intention. This is addressed in https://github.com/magento/inventory/pull/2670 but it seems like the fix introduces new issues.
To get the prices showing \Magento\Catalog\Pricing\Render\FinalPriceBox::_toHtml also needs to be adjusted as it has a check for salable through \Magento\ConfigurableProduct\Plugin\Catalog\Model\Product\Pricing\Renderer\SalableResolver::afterIsSalable without checking the "show out of stock" setting first.
Hi @wexo-team. 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.
@magento I am working on this
@TadeuRodrigues thanks for starting work on the issue. Any progress yet? Do you have any thoughts on what release it might be introduced in?
@wexo-team not yet but i gonna have a release so soon (this week, I will text you)
Hi guys, were you able to find any solution here? It seems eveyone reached eventually the same conclusion about this issue which led here. I'm finding myself in the same predicament and looking for a workaround
Unless I am missing something significant, it looks to me like there's a remarkable typo in: \Magento\InventoryConfigurableProduct\Pricing\Price\LowestPriceOptionsProvider\StockStatusBaseSelectProcessor::process
The early exit currently is:
if (!$this->stockConfig->isShowOutOfStock()) {
return $select;
}
However, since this method is adding stock filtering, the early should be:
if ($this->stockConfig->isShowOutOfStock()) {
return $select;
}
Reference: https://github.com/magento/inventory/blob/1.2-develop/InventoryConfigurableProduct/Pricing/Price/LowestPriceOptionsProvider/StockStatusBaseSelectProcessor.php#L99