Skip to content

Module Integrations

Dependencies and cross-module integration patterns

6 Dependencies Swatches GraphQL

Integration Overview

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.

Magento_Catalog
Magento_Quote
Magento_Sales
Magento_ConfigurableProduct
Magento_Swatches
Magento_CatalogSearch
ConfigurableProductGraphQl

Module Dependencies

These modules must be loaded before ConfigurableProduct:

Required Magento_Catalog

Provides the core product entity, EAV attributes, and product types framework.

  • Product entity and repository
  • EAV attribute system for super attributes
  • Product type abstract class
  • Category and product linking

Required Magento_Quote

Cart and quote management for configurable product items.

  • Quote item processing
  • Product option storage
  • Parent-child quote item linking
  • Custom option handling

Required Magento_Sales

Order management and item processing.

  • Order item conversion
  • Product options in orders
  • Invoice/shipment item handling
  • Admin order item display

Required Magento_CatalogInventory

Stock management for configurable and child products.

  • Stock status aggregation
  • Quantity validation
  • Salability checks
  • Stock indexer integration

Required Magento_Checkout

Checkout process handling.

  • Add to cart processing
  • Cart page display
  • Mini-cart integration
  • Checkout validation

Required Magento_Msrp

Manufacturer's suggested retail price support.

  • MSRP display on configurable
  • MAP pricing rules
  • Price masking integration

Key Module Integrations

Magento_Swatches Integration

Visual attribute selection instead of dropdowns:

Swatch Renderer

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.

  • Color swatches with hex codes
  • Image swatches for patterns
  • Text swatches for sizes
  • Image switching on option select
// 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
];

Price Indexer Integration

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

MSI (Multi-Source Inventory) Integration

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

GraphQL Integration

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]
}

Elasticsearch/OpenSearch Integration

Configurable products and their children are indexed for search:

Search Indexing

  • Parent configurable indexed with aggregated child data
  • Filterable attributes include all child values
  • Price range from min to max child price
  • Stock status reflects child availability

Cart & Checkout Integration

Quote Item Structure

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

CartItemProcessor

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]);
    }
}

Admin Integration

Product Edit Form

Special UI components for configurable product management:

Admin UI Components

  • Configurations tab - Manage super attributes and child products
  • Variation wizard - Create all combinations from attribute options
  • Associated products grid - Manage linked simple products
  • Bulk price/stock editing - Update all children at once

Import/Export

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