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

In product list all swatches are always shown even if they are not available when "Display Out of Stock Products" is disabled #4100

Merged

Conversation

empiricompany
Copy link
Contributor

@empiricompany empiricompany commented Jul 17, 2024

Description (*)

In the product list, all swatches are always shown even if they are not available.
You can verify this on the PDP because only the available ones are displayed correctly.

Tested with both enabled and disabled stock inventory configuration "Display Out of Stock Products"

inventory_settings

When "Display Out of Stock Products" is enabled shown correctly like this:
show_out_of_stock

When "Display Out of Stock Products" is disabled all swatches are always shown even if they are not available.
With this patch shown correctly like this:

not_out_of_stock

The bug occurs when the " Display Out of Stock Products" configuration is disabled.

Related Pull Requests

Fixed Issues (if relevant)

#3527

Manual testing scenarios (*)

  1. Create configurable product with options as swatch such as color
  2. Set stock unavailable for one color option

Example with sample data:

  1. In product configurable Name: "Nolita cami" SKU "wbk000c" set all children products with color pink unavailable.

In the product list, all colors are always shown even if they are not available.
You can verify this on the PDP because only the available ones are displayed correctly.

pdp
pl

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All automated tests passed successfully (all builds are green)
  • Add yourself to contributors list

@github-actions github-actions bot added the Component: ConfigurableSwatches Relates to Mage_ConfigurableSwatches label Jul 17, 2024
@empiricompany
Copy link
Contributor Author

Sorry @fballiano you can delete this #4099 please?

@fballiano
Copy link
Contributor

@empiricompany as of today I'm no longer part of this project

@empiricompany
Copy link
Contributor Author

@empiricompany as of today I'm no longer part of this project

What?? This is unacceptable, this project would have died without you! What did I miss?

@sreichel
Copy link
Contributor

Smart change. 👍

What is this flag for? See https://magento.stackexchange.com/questions/106455/get-product-stock-quantity-in-magento/209510#209510.

@addison74 please test for #1694, too.

@addison74
Copy link
Contributor

@sreichel - I will.

Please check this one #3527. It could be related too.

Copy link
Contributor

@kiatng kiatng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ref

if ($productCollection->hasFlag('require_stock_items')) {
Mage::getModel('cataloginventory/stock')->addItemsToProducts($productCollection);
} else {

@sreichel sreichel merged commit 6c5f04a into OpenMage:main Sep 22, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: ConfigurableSwatches Relates to Mage_ConfigurableSwatches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants