The Challenge

A Shopware 6 store with extensive variant products was displaying inconsistent and often misleading product information across different storefront surfaces. Customers frequently encountered out-of-stock variants in listings while in-stock alternatives existed, eroding trust and causing unnecessary friction.

Critical Pain Points

  • Listings and search results showed arbitrary variants with no stock awareness, frequently surfacing unavailable options
  • Manufacturer listing pages displayed parent products instead of resolved variants, breaking visual consistency with category and search pages
  • Product detail pages had no position-based variant resolution, ignoring merchandising preferences set through property group ordering
  • Stock availability indicators in product cards were inaccurate because listings return individual variants without sibling stock context
  • The quote request form returned parent product data instead of the best variant, leading to wrong cover images and product references

Each product surface had its own ad-hoc variant handling, creating a fragmented experience where the same product could appear differently depending on how the customer navigated to it. There was no single source of truth for variant resolution.

The Solution

Built a centralized VariantPreselectionService with DBAL-powered queries that serves as the single source of truth for variant resolution across every product surface.

Position-Based Variant Resolution

A reusable DBAL service that selects the best variant per parent product based on property group option position, with language-aware COALESCE fallbacks through the full language chain.

Stock-Aware Selection Logic

Prioritizes in-stock variants over out-of-stock ones. When no variant is in stock, falls back to the first by position so the display remains deterministic and merchandising-friendly.

Unified Surface Coverage

Event-based subscribers hook into Shopware's product listing and variant resolution lifecycle to apply the same logic on category, search, manufacturer, PDP, and quote request surfaces.

Sibling Stock Enrichment

Enriches every listed variant with a custom stock extension by querying sibling stock via DBAL, so templates can show accurate availability without additional API calls.

Results & Business Impact

Consistent Variant Display Across All Surfaces

Category listings, search results, manufacturer pages, PDP, and quote request forms all resolve to the same best variant using a single service.

Accurate Stock Availability Indicators

Product cards now reflect true availability by checking sibling variant stock, eliminating false out-of-stock signals when alternatives exist.

Zero N+1 Query Performance

All variant resolution uses batched DBAL queries grouped by parent ID, avoiding the performance pitfall of per-product database calls.

Respects User Intent on PDP

When a customer explicitly selects a variant through the configurator, the system defers to their choice instead of overriding it with the pre-selected variant.

Technologies Used

Shopware 6PHP 8SymfonyDBALTwigMySQLEvent Subscribers

Project Details

Industry
E-commerce
Location
Germany
Project Type
Plugin Feature
Duration
2 weeks

Need Smarter Product Display Logic?

Variant-heavy catalogs need intelligent display logic to surface the right product at the right time. We build systems that optimize what your customers see.

Get Expert Help from Elixent Digital

Share this case study

Found this interesting? Share it with your network