Magento 2 Configurable Product Persistence: When 'Out of Stock' Doesn't Mean Gone
Unpacking a Critical Magento 2.4.6-p8 Bug: Configurable Product Visibility After Stock Depletion
As e-commerce migration experts at Shopping Mover, we constantly monitor the Magento community for critical issues that can impact merchant operations and development efforts. A recent GitHub issue (#40739) highlights a significant bug in Magento 2.4.6-p8 that affects configurable product visibility and pricing, especially problematic for headless implementations utilizing GraphQL.
The Core Problem: Configurable Products Lingering in Categories
The reported issue describes a scenario where, despite all child products of a configurable product becoming unsalable (out of stock) after a purchase, the parent configurable product inexplicably remains visible in its assigned category. This occurs even when the 'Display out of stock product' setting is explicitly set to 'NO' in the Magento configuration.
The problem is exacerbated by two critical side effects:
- The configurable product displays with an 'Out of Stock' status, contradicting the store's configuration.
- For headless sites using GraphQL, the
productsquery returns the configurable product, but itsprice_rangeattribute shows a misleading$0value.
Steps to Reproduce the Glitch
The author, adarshkhatri, provided clear steps to reproduce this S1 severity bug:
- Setup: Magento 2.4.6-p8 with MSI, configured stock/sources, RabbitMQ running consumers (especially
inventory.reservability.updateSalabilityStatus), Elastic Search, and crucially, 'Display out of stock product' set to 'NO'. - Product Creation: Create a configurable product (e.g., 'my-config') with a single child product (e.g., 'my-config-red') having 1 quantity and backorders disabled. Both products are visible in 'catalog, search' and assigned to a category.
- Initial Check: Verify both products appear on the frontend category page.
- Purchase & Depletion: Add the child product to the cart and complete checkout, depleting its stock.
- System Processing: Allow the
inventory.reservations.updateSalabilityStatusconsumer to finish its run. - Observation: Revisit the category page. The child product disappears as expected, but the configurable product persists, showing 'Out of Stock' and, if queried via GraphQL, a
$0price.
The GraphQL Anomaly
For merchants leveraging Magento's GraphQL API for headless storefronts, this bug presents a severe data integrity issue. The products query, when fetching the configurable product, returns:
"price_range": {
"minimum_price": {
"final_price": {
"value": 0
}
}
},
This incorrect price data can lead to a poor user experience, broken storefront logic, and potentially lost sales due to misleading product information.
Impact and Implications for Magento Users
This bug, rated S1 (affecting critical data/functionality and forcing workarounds), has significant implications:
- Inaccurate Storefront: Customers see unavailable products, cluttering category pages and potentially causing frustration.
- Data Inconsistency: The discrepancy between backend stock status and frontend visibility creates data integrity issues.
- Headless Challenges: For GraphQL-powered storefronts, the `$0` price creates a critical display error, necessitating complex workarounds at the application level.
- Resource Drain: Developers and merchants must invest time in identifying, confirming, and implementing temporary fixes or waiting for an official patch.
As of this insight, the GitHub issue is marked 'ready for confirmation' and lacks immediate community-provided solutions or workarounds within the thread itself. This means developers encountering this issue will need to investigate custom observers, re-indexing strategies, or potential GraphQL schema adjustments to mitigate the impact while awaiting an official fix from Adobe Commerce.
This issue underscores the importance of thorough testing, especially for complex product types like configurable products, and the need for robust inventory management systems in Magento 2. Developers should be aware of this specific behavior when upgrading to or working with Magento 2.4.6-p8, particularly in headless environments.