Show Main Products in Listing and Product Detail Page

29.10.2025

If you've ever struggled with Shopware's visibility settings, you know how frustrating it can be. By default, if a product has variants, Shopware hides the main product from category listings and automatically switches the product in the detail page (PDP) to a variant.

I ran into the same problem: I wanted main products to appear in listings and still display the main product on the PDP, even if it had variants, while listing those variants inside the page. At first, it seemed simple, but Shopware's default behavior makes it more complicated than expected.

The Problems I had

Default Shopware behavior:

Even adjusting storefront visibility (Main Product: Everywhere, Variants: Search only) fixes the listing but not the PDP — opening a main product still loads a variant.

Variant storefront presentation for productl listing

This screenshot was taken from Shopware 6.7.3.1.

The solution for the Variant listing in the pdp

The fix requires a small plugin using an event subscriber to override Shopware's variant resolution. The key is the ResolveVariantIdEvent. By hooking into this event, you can set the PDP to display the main product or other product id's.

Working code example

class ProductPageSubscriber implements EventSubscriberInterface { public static function getSubscribedEvents(): array { return [ ResolveVariantIdEvent::class => 'onProductPageLoaded', ]; } public function onProductPageLoaded(ResolveVariantIdEvent $event): void { $event->setResolvedVariantId($event->getProductId()); } }

How it works

Shopware normally selects a “best variant” for the PDP if a main product has variants. The subscriber overrides this by setting the resolved product ID to the main product itself.

Notes

Shoutout to the helpful user on Discord who guided me toward this solution — it made the process much faster.