Skip to content
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

Configurable product price is not displayed if all children are out of stock and even if Display Out of Stock Products is set to "yes" #16069

Closed
alexber88 opened this issue Jun 12, 2018 · 15 comments
Labels
Component: ConfigurableProduct Event: MM18ID Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@alexber88
Copy link

alexber88 commented Jun 12, 2018

Preconditions

  1. Magento CE 2.2.2 with Sample Data
  2. PHP 7.0

Steps to reproduce

  1. Create configurable product with view simples
  2. Make configurable and all simple products out of stock
  3. Set Display Out of Stock Products to "yes"

Expected result

  1. Price for configurable product should be displayed

Actual result

  1. Price is not displayed at all

Seems like in \Magento\ConfigurableProduct\Model\ResourceModel\Product\StockStatusBaseSelectProcessor::process() there is incorrect condition.
It should be:
if (!$this->stockConfig->isShowOutOfStock()) {

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Jun 12, 2018
@engcom-backlog-nickolas engcom-backlog-nickolas added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Jul 6, 2018
@engcom-backlog-nickolas
Copy link

Hello @alexber88, thank you for your report.
We've acknowledged the issue and added to our backlog.

@indraraka
Copy link

I am working on this #mm18id

@magento-engcom-team
Copy link
Contributor

@indraraka thank you for joining. Please accept team invitation here and self-assign the issue.

@ktpl-prakash
Copy link
Contributor

#prakashpatel07

@akashkarev akashkarev self-assigned this Aug 11, 2018
@akashkarev
Copy link

Looks like the problem is caused by vendor/magento/module-configurable-product/Plugin/Model/ResourceModel/Attribute/InStockOptionSelectBuilder.php

Especially by the condition below
$select->joinInner( ['stock' => $this->stockStatusResource->getMainTable()], 'stock.product_id = entity.entity_id', [] )->where( 'stock.stock_status = ?', \Magento\CatalogInventory\Model\Stock\Status::STATUS_IN_STOCK );

It should depend on the setting cataloginventory/options/show_out_of_stock

@akashkarev akashkarev removed their assignment Aug 11, 2018
@josh-carter
Copy link

Possibly related to #12936 & #10454

@zhartaunik
Copy link
Contributor

You are looking at wrong places. Final price in index table equals zero. Need to fix indexation process.

@vpodorozh vpodorozh self-assigned this Oct 18, 2018
@magento magento deleted a comment from magento-engcom-team Oct 18, 2018
@vpodorozh
Copy link
Contributor

You are looking at wrong places. Final price in index table equals zero. Need to fix indexation process.

No @zhartaunik - it is not an indexation problem. Current behaviour was added as a side effect of this issue "MAGETWO-72582: Configurable product displays the price of "out of stock" configuration".
I'm working on fix now, the general idea is to allow "out of stock" items to be used for price determination of configurable product ONLY in case all child products are "out of stock".

vpodorozh added a commit to vpodorozh/magento2 that referenced this issue Oct 22, 2018
…ldren are out of stock and even if Display Out of Stock Products is set to "yes"

- allow "out of stock" items to be used for price determination of configurable product ONLY in case all child products are "out of stock".
vpodorozh added a commit to vpodorozh/magento2 that referenced this issue Oct 24, 2018
…ldren are out of stock and even if Display Out of Stock Products is set to "yes"

- add blank space.

(cherry picked from commit 0b19e04)
vpodorozh added a commit to vpodorozh/magento2 that referenced this issue Oct 24, 2018
…ldren are out of stock and even if Display Out of Stock Products is set to "yes"

- remove unneeded usage of the variable.

(cherry picked from commit 207e2e1)
vpodorozh added a commit to vpodorozh/magento2 that referenced this issue Oct 24, 2018
…ldren are out of stock and even if Display Out of Stock Products is set to "yes"

(cherry picked from commit f4ec67e)
brosenberger pushed a commit to brosenberger/magento2 that referenced this issue Nov 15, 2018
…ubitems

* the current logic is inversed as it will add the filter for stock only elements when the option is activated
* this commit fixes magento#16069
vpodorozh added a commit to vpodorozh/magento2 that referenced this issue Feb 6, 2019
…ldren are out of stock and even if Display Out of Stock Products is set to "yes"

- allow "out of stock" items to be used for price determination of configurable product ONLY in case all child products are "out of stock".

(cherry picked from commit 80f6a36)

magento#16069: Configurable product price is not displayed if all children are out of stock and even if Display Out of Stock Products is set to "yes"
- add strict types.

(cherry picked from commit b786871)

magento#16069: Configurable product price is not displayed if all children are out of stock and even if Display Out of Stock Products is set to "yes"
- refactor variable names.

(cherry picked from commit d009296)

magento#16069: Configurable product price is not displayed if all children are out of stock and even if Display Out of Stock Products is set to "yes"
- add blank space.

(cherry picked from commit 0b19e04)

magento#16069: Configurable product price is not displayed if all children are out of stock and even if Display Out of Stock Products is set to "yes"

- remove unneeded usage of the variable.

(cherry picked from commit 207e2e1)

magento#16069: Configurable product price is not displayed if all children are out of stock and even if Display Out of Stock Products is set to "yes"

(cherry picked from commit f4ec67e)

magento#16069: Configurable product price is not displayed if all children are out of stock
- change request

magento#16069: Configurable product price is not displayed if all children are out of stock
- change request

magento#16069: Configurable product price is not displayed if all children are out of stock
- change request

magento#16069: Configurable product price is not displayed if all children are out of stock
- change request
@ghost ghost assigned vpodorozh and unassigned vpodorozh Jul 14, 2019
@sdzhepa
Copy link
Contributor

sdzhepa commented Aug 2, 2019

Hello @alexber88

This issue was investigated by internal Magento team in the scop of related Jira ticket.
The described flow was additionally discussed with Product Managers/Owners and was confirmed it is not a bug but expected behavior, this requirement covered by internal test case.

Unfortunately, I have to close this issue as well because such changes will not be approved.

To help at least somehow I would recommend having a look at this topic on the Magento Community Forum. Possibly it has a custom solution for this issue

@mattyl
Copy link

mattyl commented Sep 25, 2019

This cant be right - as it is duplicate of #23196
My owners expect that out of stock options are visible but grey out and not accesible - this is pretty standard eCommerce experience adn has been available in previous versions of magento

@nordcomputer
Copy link

I just created a small module to show the price of out-of-stock items based on this answer at stackexchange. Feel free to fork:
https://github.com/nordcomputer/magento2-showoutofstockprice

Composer install should work, if you add the repo to your dependencies. Be aware, that I set the required php version to "^7.1" - you may need to reconfigure that in the cmposer.json file, if you use another version.

@vitormcsi
Copy link

I just created a small module to show the price of out-of-stock items based on this answer at stackexchange. Feel free to fork:
https://github.com/nordcomputer/magento2-showoutofstockprice

Composer install should work, if you add the repo to your dependencies. Be aware, that I set the required php version to "^7.1" - you may need to reconfigure that in the cmposer.json file, if you use another version.

Thanks for this, but in list page not show, you can fix this? Thanks.

@nordcomputer
Copy link

nordcomputer commented Sep 3, 2021

I just created a small module to show the price of out-of-stock items based on this answer at stackexchange. Feel free to fork:
https://github.com/nordcomputer/magento2-showoutofstockprice
Composer install should work, if you add the repo to your dependencies. Be aware, that I set the required php version to "^7.1" - you may need to reconfigure that in the cmposer.json file, if you use another version.

Thanks for this, but in list page not show, you can fix this? Thanks.

Hey @vitormcsi,
could you open an issue directly in the extension and explain a bit more?
What magento version are you using, did you configure the system configuration (show out of stock products) to yes (not the extension configuration)?

Normally, the extension shows prices also on the category and search result pages.

@vitormcsi
Copy link

Sorry @nordcomputer, I reindex and fix all, Many Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: ConfigurableProduct Event: MM18ID Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests