ecomhouse/defaultvariant lets a merchant mark one child product of a configurable product as
its default variant. It adds a default_variant product attribute plus an admin control in
the configurable product's Configurations matrix — a Choose Default Variant action on each
variant row — that stores the chosen child's ID on the parent. The attribute is exposed to the
storefront (product listing and product view) so a theme or integration can read it and open the
product on that variation.
Polish usage guide: docs/jak-uzywac.md.
| Requirement | Version |
|---|---|
| Magento Open Source | 2.4.x |
| PHP | >= 8.2 |
Magento_ConfigurableProduct |
core |
Magento_Catalog, Magento_Eav |
core |
No ecomhouse/base dependency — this module ships no admin config section and hangs nothing off
the ecomhouse menu.
composer require ecomhouse/defaultvariant
bin/magento module:enable EcomHouse_DefaultVariant
bin/magento setup:upgrade
bin/magento setup:static-content:deploy -f
bin/magento cache:flushcd app/code
mkdir -p EcomHouse/DefaultVariant
# Extract module files into the directory created above
bin/magento module:enable EcomHouse_DefaultVariant
bin/magento setup:upgrade
bin/magento cache:flushbin/magento module:status EcomHouse_DefaultVariantExpected: Module is enabled. setup:upgrade also creates a Default Variant Id
(default_variant) text attribute on the product entity, applied to configurable products
(Stores > Attributes > Product).
There is no Stores > Configuration section. The module works entirely from the product edit
page: open a configurable product, and each row of the Configurations matrix gains a
Choose Default Variant item in its Select action menu. Picking it marks that variant as the
default (the chosen row is outlined in green) and saves its ID into the default_variant
attribute on save.
Full walkthrough: docs/how-to-use.md. Polish version: docs/jak-uzywac.md.
bin/magento module:disable EcomHouse_DefaultVariant
composer remove ecomhouse/defaultvariant
bin/magento setup:upgrade
bin/magento cache:flushUninstalling does not remove the default_variant EAV attribute — remove it manually at
Stores > Attributes > Product first if you want a clean removal.
- Email: opensource@ecom.house
- Website: https://ecom.house/
- Changelog: CHANGELOG.md
- License: OSL-3.0