Module Integrations
Dependencies and cross-module integration patterns
Dependencies and cross-module integration patterns
Magento_ConfigurableProduct integrates deeply with the catalog, pricing, inventory, and checkout systems. It depends on 6 core modules and provides integration points for swatches, search, and GraphQL.
These modules must be loaded before ConfigurableProduct:
Provides the core product entity, EAV attributes, and product types framework.
Cart and quote management for configurable product items.
Order management and item processing.
Stock management for configurable and child products.
Checkout process handling.
Manufacturer's suggested retail price support.
Visual attribute selection instead of dropdowns:
When configurable options use swatch attributes (color, size), the frontend renders visual selectors instead of dropdowns. ConfigurableProduct provides the base option data structure that Swatches extends.
// Swatches extends configurable JSON config
$jsonConfig = $this->getJsonConfig();
$swatchConfig = $this->getSwatchConfig();
// Combined output for RequireJS
return [
'Magento_ConfigurableProduct/js/configurable' => $jsonConfig,
'Magento_Swatches/js/swatch-renderer' => $swatchConfig
];
Configurable product prices are indexed based on their children:
// Configurable price indexer
// catalog_product_index_price stores the minimum child price
INSERT INTO catalog_product_index_price
SELECT
parent.entity_id,
MIN(child.min_price) AS min_price,
MIN(child.final_price) AS final_price,
MAX(child.max_price) AS max_price
FROM catalog_product_entity parent
JOIN catalog_product_super_link link ON parent.entity_id = link.parent_id
JOIN catalog_product_index_price child ON link.product_id = child.entity_id
WHERE parent.type_id = 'configurable'
GROUP BY parent.entity_id
ConfigurableProduct works with MSI through stock status aggregation:
| Component | Integration Point |
|---|---|
InventoryConfigurableProduct |
Separate module that bridges ConfigurableProduct with MSI |
| Stock aggregation | Parent salable if any child has stock in any source |
| Reservation system | Reservations created against child product SKU |
| Source selection | Child product determines fulfillment source |
ConfigurableProduct exposes schema extensions for headless:
# GraphQL schema extensions (ConfigurableProductGraphQl module)
type ConfigurableProduct implements ProductInterface {
configurable_options: [ConfigurableProductOptions]
variants: [ConfigurableVariant]
}
type ConfigurableProductOptions {
id: Int
attribute_id: String
label: String
values: [ConfigurableProductOptionsValues]
}
type ConfigurableVariant {
product: SimpleProduct
attributes: [ConfigurableAttributeOption]
}
Configurable products and their children are indexed for search:
When added to cart, configurable products create two linked quote items:
| Item | Type | Visible | Purpose |
|---|---|---|---|
| Parent Item | configurable | Yes | Display in cart, show selected options |
| Child Item | simple | No | Actual product for pricing, inventory, fulfillment |
// Quote item relationship $parentItem->getChildren(); // Returns [childItem] $childItem->getParentItem(); // Returns parentItem // Child item flags $childItem->isChildrenCalculated(); // true $parentItem->isChildrenCalculated(); // true // Price comes from child $parentItem->getPrice(); // Calculated from child
Handles REST/GraphQL cart operations for configurable items:
class CartItemProcessor implements CartItemProcessorInterface
{
public function convertToBuyRequest(CartItemInterface $cartItem)
{
$productOption = $cartItem->getProductOption();
$options = $productOption->getExtensionAttributes()
->getConfigurableItemOptions();
$superAttribute = [];
foreach ($options as $option) {
$superAttribute[$option->getOptionId()] = $option->getOptionValue();
}
return new DataObject(['super_attribute' => $superAttribute]);
}
}
Special UI components for configurable product management:
Configurable products have special handling during import:
| Column | Format | Purpose |
|---|---|---|
configurable_variations |
sku=CHILD1,color=Red,size=M|sku=CHILD2... | Defines child products and their attribute values |
configurable_variation_labels |
Color=Colour,Size=Taille | Store-specific attribute labels |