PHPackages                             shopwhizzy/module-configurable-pre-select - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. shopwhizzy/module-configurable-pre-select

ActiveMagento2-module

shopwhizzy/module-configurable-pre-select
=========================================

Lets merchants pick a default variant on configurable products, pre-selected automatically on product and category pages. Theme-agnostic (Luma &amp; Hyvä) with zero frontend files.

1.0.0(1mo ago)001OSL-3.0PHPPHP &gt;=8.1

Since Jul 16Pushed 1mo agoCompare

[ Source](https://github.com/shopwhizzy/magento2-configurablepreselect)[ Packagist](https://packagist.org/packages/shopwhizzy/module-configurable-pre-select)[ RSS](/packages/shopwhizzy-module-configurable-pre-select/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

ShopWhizzy\_ConfigurablePreSelect
=================================

[](#shopwhizzy_configurablepreselect)

Magento 2 module that lets merchants choose a **default pre-selected variant** for configurable products. The chosen variant's options (e.g. *Color = White*) are selected automatically for customers on:

- **Product pages** (PDP)
- **Category / search listing pages** (swatch renderer)

Works on **Luma and Hyvä** (and any theme using core's configurable JSON config) — the module ships **zero frontend files**.

How it works
------------

[](#how-it-works)

The module stores the chosen child product's `entity_id` in a hidden product attribute (`sw_default_variant_id`). On the storefront, a single plugin on `Magento\ConfigurableProduct\Block\Product\View\Type\Configurable::getJsonConfig()`resolves that child's super-attribute options and sets them as Magento's native *preconfigured values*. Core then emits them as `defaultValues` in the standard swatch/configurable JSON config, which both Luma's `swatch-renderer.js`/`configurable.js` and Hyvä's `initConfigurableOptions()` already honor natively.

Because the listing swatch block (`Magento\Swatches\Block\Product\Renderer\Listing\Configurable`) extends the same base block, one plugin covers PDP and listings alike. A second plugin adds the attribute to product collections so listing pages can see it.

Admin usage
-----------

[](#admin-usage)

1. Open any **configurable** product in the admin.
2. In the **Configurations** panel, find the **Default Pre-Selected Option** dropdown, listing the product's current variants by their configurable attribute labels and SKU.
3. Pick a variant (or *-- No default selection --* to disable) and **Save**.

Installation
------------

[](#installation)

### app/code

[](#appcode)

```
mkdir -p app/code/ShopWhizzy/ConfigurablePreSelect
# copy the module files there, then:
bin/magento module:enable ShopWhizzy_ConfigurablePreSelect
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush
```

### Composer (from a VCS repository)

[](#composer-from-a-vcs-repository)

```
composer config repositories.shopwhizzy-configurablepreselect vcs https://github.com/ShopWhizzy/module-configurable-pre-select
composer require shopwhizzy/module-configurable-pre-select
bin/magento module:enable ShopWhizzy_ConfigurablePreSelect
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush
```

Compatibility
-------------

[](#compatibility)

- Magento Open Source / Adobe Commerce **2.4.x**
- PHP **8.1+**
- Themes: **Luma**, **Hyvä**, and any theme consuming core's configurable/swatch JSON config

Technical notes
---------------

[](#technical-notes)

- The attribute is created by a data patch and assigned to **all** product attribute sets, so it works for every configurable product regardless of attribute set.
- The attribute is hidden from the standard attribute UI (`visible = false`); the admin field is injected into the Configurations panel via a UI component form modifier with an explicit `data.product.*` dataScope.
- If the selected variant is later disabled or unassigned, the module silently falls back to no pre-selection — no errors on the storefront.
- Multi-attribute configurables are supported: all of the chosen child's super-attribute options are pre-selected.

License
-------

[](#license)

Open Software License (OSL 3.0)

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance90

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

46d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2630478?v=4)[ShopWhizzy](/maintainers/shopwhizzy)[@shopwhizzy](https://github.com/shopwhizzy)

---

Top Contributors

[![shopwhizzy](https://avatars.githubusercontent.com/u/2630478?v=4)](https://github.com/shopwhizzy "shopwhizzy (2 commits)")

---

Tags

magento2swatcheshyvaconfigurable-productpreselectdefault-variant

### Embed Badge

![Health badge](/badges/shopwhizzy-module-configurable-pre-select/health.svg)

```
[![Health](https://phpackages.com/badges/shopwhizzy-module-configurable-pre-select/health.svg)](https://phpackages.com/packages/shopwhizzy-module-configurable-pre-select)
```

###  Alternatives

[mollie/magento2

Mollie Payment Module for Magento 2

1162.0M19](/packages/mollie-magento2)[dotdigital/dotdigital-magento2-extension

Dotdigital for Magento 2

50413.8k28](/packages/dotdigital-dotdigital-magento2-extension)[buckaroo/magento2

Buckaroo Magento 2 extension

32431.3k8](/packages/buckaroo-magento2)[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

68365.7k](/packages/run-as-root-magento2-prometheus-exporter)[loki/magento2-admin-components

Admin Panel grids and forms created via Loki Components

1712.4k10](/packages/loki-magento2-admin-components)[yireo/magento2-emailtester2

Preview transactional emails and test send them in your backend

34452.5k](/packages/yireo-magento2-emailtester2)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
