Simple Configurable Products for Magento 2
Link existing simple products together and present them on the storefront as one product with selectable variations, such as Color, Size and Finish, without converting them into a native configurable product. Every variation stays a normal simple product with its own SKU, price, stock, URL, images and SEO data.
Requirements
| Dependency | Version | Notes |
|---|---|---|
| Magento Open Source / Adobe Commerce | 2.4.4 – 2.4.9 | |
| PHP | 8.1 – 8.4 | Required by Magento framework |
| magento/framework | 103.0.* / 104.0.* | Installed via Composer |
| Storefront theme | Luma or Hyvä | Luma-based themes use the RequireJS selector; Hyvä 1.3+ is supported from 1.1.0 |
Installation
Install via Composer after configuring your credentials. See your dashboard for your license key.
composer config repositories.ayasoftware composer https://www.ayasoftware.com/repo
auth.json (one-time)composer config --global http-basic.www.ayasoftware.com your@email.com YOUR_LICENSE_KEY
Your license key is available in the Ayasoftware dashboard.
composer require ayasoftware/simple-configurable-products:^1.1
bin/magento module:enable Ayasoftware_SimpleConfigurableProducts
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
bin/magento cache:flush
setup:upgrade adds a Variations product link type and the Variation Attributes and Variation Layout product attributes in the General group. No manual attribute-set edits are needed for these.Verify the installation
bin/magento module:status Ayasoftware_SimpleConfigurableProducts
Then confirm Stores → Configuration → Ayasoftware → Simple Configurable Products exists in the admin, and that the product edit page has a Product Variations block under Related Products, Up-Sells, Cross-Sells and Variations.
Settings
Go to Stores → Configuration → Ayasoftware → Simple Configurable Products. Every setting can be changed per website and per store view.
| Setting | Default | Description |
|---|---|---|
| Enable module | Yes | Shows the per-attribute variation selector on product pages. The "Shop by" layouts set on each product are not affected by this switch. |
| Show Price in Dropdown | No | Adds each variation's final price to its label in the Dropdown layout. |
| Show Out of Stock Items in Dropdown | Yes | Lists out-of-stock variations in the Dropdown layout, labelled "(Out of Stock)". When set to No they are left out. |
| Make Out of Stock Items Selectable in Dropdown | No | Lets shoppers open an out-of-stock variation from the dropdown instead of showing it disabled. Requires the previous setting. |
| Grid Image Width (px) | 80 | Thumbnail width of each tile in the Grid layout. |
Linking Products
A variation group is a set of simple products linked to each other. Complete these steps for each group:
Each simple product in the group needs a value for every attribute used as an axis. For example, a chair sold in 2 colours, 2 sizes and 2 finishes needs Color, Size and Finish filled in on every product. Each product should be enabled and visible in Catalog, Search so it has its own URL.
Open any product of the group, expand Related Products, Up-Sells, Cross-Sells and Variations, click Add Product Variations, select the other products and save. The grid shows each product's Qty and Stock Status to help you choose.
In the General group, set Variation Attributes to the attributes shoppers choose between, for example Color, Size and Finish. Set it on every product in the group; Catalog → Products → Actions → Update attributes does this in one go.
Select one or more of Grid, List and Dropdown to also show a "Shop by" block listing every variation in the group. Leave it empty to show only the attribute selector. See Storefront Display.
Storefront Display
Variation selector
The product page shows one selector per variation attribute, with the current product's values preselected. When the shopper changes a value, they go to the product that matches their selection.
| Theme | How options are shown |
|---|---|
| Luma-based | One dropdown per attribute. Once every attribute has a value, the shopper is taken to the matching product. |
| Hyvä 1.1.0+ | Colour swatches for visual-swatch attributes and option buttons for the rest, above the price and Add to Cart. Each option links straight to the matching product. See Hyvä Theme. |
"Shop by" layouts
Set per product in Variation Layout. Several can be enabled at once.
| Layout | Shows |
|---|---|
| Grid | An image tile per variation with its attribute values. The current product is highlighted and out-of-stock variations are marked. |
| List | A row per variation with its SKU and attribute values. |
| Dropdown | A single dropdown of all variations. Price and out-of-stock behaviour follow the Settings. |
What changes when the shopper switches
Each variation is its own product page, so everything on the page belongs to the selected variation: URL, title, images, SKU, price, tier prices, stock status, description, reviews and meta tags. Add to Cart adds that exact simple product, so the cart, order and invoice show its real SKU.
Hyvä Theme New in 1.1.0
Hyvä support is built in; there is no separate compatibility module to install. On any store view whose theme is Hyvä-based, the extension switches to its Hyvä template automatically. Luma store views on the same installation keep the original selector.
Multi-attribute behaviour
Each option links to the product that has that value and the shopper's current values for the other attributes. If that exact combination doesn't exist or is out of stock, the option is shown crossed out and links to the closest available variation. Attributes earlier in Variation Attributes are kept first, so with Color, Size and Finish the shopper's colour is kept before their finish.
Placement
The selector sits inside the add-to-cart form (product.info.form), above the price and Add to Cart button. Hyvä only renders that form for salable products, so on an out-of-stock variation the selector is rendered in product.info.additional instead, and shoppers can still switch to an available variation.
Customising the look
Override the CSS custom properties on .scp-hyva in your theme:
CSS.scp-hyva {
--scp-accent: #1d4ed8; /* selected option outline */
--scp-border: #d1d5db; /* option border */
--scp-border-hover: #6b7280;
--scp-text: #111827;
--scp-muted: #6b7280; /* selected value, captions */
--scp-radius: 0.375rem;
}
To change the markup, override the template in your Hyvä child theme at app/design/frontend/<Vendor>/<theme>/Ayasoftware_SimpleConfigurableProducts/templates/hyva/variations.phtml.
CSV Import New in 1.1.2
Variation groups can be created with Magento's standard product import (System → Data Transfer → Import, entity type Products), or any tool that uses it. Two columns are added for this:
| Column | Used for |
|---|---|
variations_skus | Comma-separated SKUs of the other products in the group. |
variations_position | Optional. Comma-separated positions, in the same order as variations_skus. |
variation_attributes | Attribute codes used as variation attributes, e.g. color,size,finish. Set on every product in the group. |
variation_layout | Optional. Any of grid, list, dropdown. |
Listing a group's SKUs on one row is enough. After the import, every product in the group is linked to every other one, the same as saving the group in the admin. Re-importing the same file is safe: it doesn't create duplicate links.
CSVsku,product_type,attribute_set_code,product_websites,name,price,qty,is_in_stock,visibility,product_online,color,size,finish,variation_attributes,variation_layout,variations_skus
CHAIR-GRAY-55-CH,simple,Default,base,"Executive Chair - Gray / 55 cm / Chrome",499,50,1,"Catalog, Search",1,Gray,55 cm,Chrome,"color,size,finish",grid,"CHAIR-GRAY-55-MB,CHAIR-BLACK-55-CH,CHAIR-BLACK-55-MB"
CHAIR-GRAY-55-MB,simple,Default,base,"Executive Chair - Gray / 55 cm / Matte Black",529,50,1,"Catalog, Search",1,Gray,55 cm,Matte Black,"color,size,finish",grid,
CHAIR-BLACK-55-CH,simple,Default,base,"Executive Chair - Black / 55 cm / Chrome",499,50,1,"Catalog, Search",1,Black,55 cm,Chrome,"color,size,finish",grid,
CHAIR-BLACK-55-MB,simple,Default,base,"Executive Chair - Black / 55 cm / Matte Black",529,0,0,"Catalog, Search",1,Black,55 cm,Matte Black,"color,size,finish",grid,
To update existing products, include only sku and the columns you are changing. Attribute values such as color and size use the option labels, which must already exist on the attribute.
REST API
Retrieve a product's variation group for headless storefronts, PWAs or external systems. The endpoint is public; no token is required.
HTTPGET /rest/V1/ayasoftware/variations/:productId
It returns one entry per product in the group, including the requested product:
JSON[
{
"id": 2050,
"sku": "AYA-EXEC-BLACK-55-CH",
"name": "Aya Executive Chair - Black / 55 cm / Chrome",
"url": "https://example.com/aya-executive-chair-black-55-cm-chrome.html",
"in_stock": true,
"price": 499,
"is_current": true,
"attributes": { "color": "Black", "size": "55 cm", "finish": "Chrome" }
}
]
attributes is keyed by attribute code, with the store-view option label as the value. An empty array is returned when the product has no linked variations.
Troubleshooting
The variation selector doesn't appear
- Confirm Enable module is Yes for the store view (see Settings).
- Confirm the product has Variation Attributes set and at least one linked variation.
- Confirm the product is a simple product and not a child of a native configurable product.
- Flush cache (
bin/magento cache:flush) after changing any of the above.
An attribute is missing from the selector
Products without a value for that attribute are skipped. Check that every product in the group has a value, and that the attribute is in each product's attribute set; see the warning in Linking Products.
A product isn't offered as a variation
It isn't linked to the group, or it is disabled or not assigned to the current website. Open any product of the group, add it under Add Product Variations and save.
Hyvä: the selector appears at the bottom of the page, or only the grid shows
You are running a version earlier than 1.1.0, which has no Hyvä template. Update, then run setup:upgrade, setup:di:compile and setup:static-content:deploy.
Hyvä: the selector is unstyled
Static content hasn't been deployed for your Hyvä theme since updating. Run bin/magento setup:static-content:deploy -f and flush the cache.
Hyvä: the selector is missing on a customised product page
Your theme removes or renames the product.info.form or product.info.additional blocks. Move the variations container to a block your theme renders, using a hyva_catalog_product_view.xml layout file in your theme.
An option is shown crossed out
This is expected on Hyvä: the exact combination with the shopper's other selections doesn't exist or is out of stock. Clicking it goes to the closest available variation.
Changelog
New
- FeatCSV import of variation groups with the new
variations_skusandvariations_positioncolumns. Listing a group on one row links every product in it.
Fixes
- FixImporting variation links had no effect on Magento 2.4.x: the import hook targeted a method Magento no longer has.
- FixREST API:
pricenow returns each variation's real final price. Previously it was always0. - FixREST API:
in_stocknow reflects actual stock status. Previously every variation was reported as in stock.
bin/magento setup:di:compile after updating in production mode.New
- FeatHyvä Theme support, built in. On Hyvä store views the selector is rendered on the server with no RequireJS or jQuery; Luma store views are unaffected.
- FeatThe Hyvä selector shows colour swatches and option buttons above the price and Add to Cart, and every option is a crawlable link to the matching product.
Improvements
- ImprWith several variation attributes, each option links to the exact combination with the shopper's other selections. When that combination doesn't exist, the option is marked unavailable and links to the closest available variation.
- ImprThe selector stays available on out-of-stock variations, so shoppers can switch to an available one.
- ImprGrid, List and Dropdown layouts work on Hyvä, and the Dropdown's script is CSP-safe.
Compatibility
- ImprHyvä Theme 1.3 and later (tested with 1.5.4). Plain CSS, so no Tailwind rebuild is needed.
bin/magento setup:upgrade, setup:di:compile and setup:static-content:deploy after updating.Maintenance
- ImprVersion bump only, no functional changes from 1.0.2.
New
- FeatNew display settings: price in the dropdown, out-of-stock visibility and selectability, and grid thumbnail size.
- FeatNew REST API endpoint for retrieving variation data.
- FeatQty and Stock Status columns in the admin variation grid.
Improvements
- ImprFaster product pages for products with many linked variations.
- ImprClearer out-of-stock indicators, selection states and checkmarks, and lazy-loaded variation images.
- ImprGrid, Dropdown and List layout styles.
- ImprBetter keyboard navigation, screen-reader support and semantic markup.
- ImprVariation labels use attribute labels instead of internal attribute codes.
Compatibility
- FixPHP 8.2+ compatibility improvements, and fixes for several stability, template-rendering and variation edge cases.
Compatibility
- ImprAdded compatibility with Magento 2.4.9.