Skip to content

Fix: visibility grouped products#353

Merged
ahuininga-orisha merged 3 commits intobetafrom
fix-visibility-grouped-products
Mar 6, 2026
Merged

Fix: visibility grouped products#353
ahuininga-orisha merged 3 commits intobetafrom
fix-visibility-grouped-products

Conversation

@ahuininga-orisha
Copy link
Collaborator

@ahuininga-orisha ahuininga-orisha commented Mar 6, 2026

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).

@ahuininga-orisha ahuininga-orisha merged commit ee5fdfd into beta Mar 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants