Fix: visibility grouped products#353
Merged
ahuininga-orisha merged 3 commits intobetafrom Mar 6, 2026
Merged
Conversation
jansentjeu
approved these changes
Mar 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request fixes the following issues with grouped products and visibility
Current Situation
When grouped products are enabled, Tweakwise results may include products that should either be displayed individually or as part of a parent product (Configurable/Group/Bundle).
Example Scenario:
Parent: A configurable T-shirt (various colors/sizes) set to be visible only in the Catalog, not in Search.
Child: A specific simple product (Red T-shirt, Size XL) set to be visible only in Search.
Currently, the system always attempts to display the parent (Configurable/Group/Bundle). Because the parent's visibility settings forbid it from appearing in search, the product is filtered out entirely, leading to "empty spots" or missing results in the search interface even when a valid child product exists.
Desired Situation
The child product should be visible in the search, the configurable in the catalog.
Solution
When grouped products is enabled the result that is passed on to magento contains both the simple and the configurable product. Magento itself filters out if the simple or configurable is not visible. And after that, we remove any remaining duplicate products. We remove the simple product if the configurable is shown. This prevents issues with the pagination as tweakwise only returns one product, so only one should be shown. For example when an configurable and an simple is visible in the catalog.
How to test
This pull request needs to be tested with the fix in the tweakwise export to ensure the parent visibility in tweakwise is correct. EmicoEcommerce/Magento2TweakwiseExport#135.
Make sure that grouped export is enabled and that the magento indexer is run after changing products.
1. The "Search" Visibility Test (The Core Fix)
Verifies that the Child product correctly surfaces when the Parent is restricted.
Setup: * Configurable Parent: Visibility = Catalog only.
Simple Child: Visibility = Search only.
Action: Search for the specific Child SKU.
Expected Result: * The Child product appears; the Parent does not.
The amount of products shown is correct, and the pagination is correct (e.g., "1 Item" displayed in toolbar, 1 card rendered).
2. The "Catalog" Visibility Test (Deduplication)
Ensures that when both are eligible for a category, we show the Parent to represent the group.
Setup:
Configurable Parent: Visibility = Catalog, Search.
Simple Child: Visibility = Catalog, Search.
Action: Navigate to the Category page.
Expected Result: * Only the Configurable Parent is visible.
The amount of products shown is correct, and the pagination is correct (Count matches unique parent entities).
3. Multiple Visible Children (The "Both Simples" Case)
Verifies that if multiple children are explicitly set to be visible in Search, the system does not deduplicate them into a single entry.
Setup: * Configurable Parent: Visibility = Catalog only.
Simple Child A (Red): Visibility = Search only.
Simple Child B (Blue): Visibility = Search only.
Action: Search for the product name (e.g., "T-shirt").
Expected Result: * Both Simple products (Red and Blue) are displayed individually.
The amount of products shown is correct, and the pagination is correct (e.g., Toolbar shows "2 Items," and 2 separate product cards are rendered).