Skip to content

Commerce Foundations is our pre-built Craft Commerce store. See what it includes

Craft CMS plugins

Variant Manager

A Craft CMS plugin for managing Craft Commerce variants as combinations of attributes and options.

Variants index

One listing of every variant in the store, with filters and a bulk edit action.

Where to find it#

Variant Manager -> Variants.

Commerce lists variants under their product. This index lists them on their own, so a filter applies across the whole catalog rather than one product at a time.

Columns#

Each row shows the variant’s product, the standard Commerce columns, whether inventory is tracked, and the stock count.

To add more, set defaultVariantTableAttributes in config/variant-manager.php to a list of variant field handles. They are appended to the columns above.

'defaultVariantTableAttributes' => ['careInstructions', 'fabricWeight'],

Each person can also change their own columns from the index, the way any Craft element index works. defaultVariantTableAttributes sets the starting columns.

Filters#

On top of Craft’s own rules and Commerce’s product and SKU rules, Add a filter offers:

  • Stock, a number rule, so equals, less than, greater than, between, and the rest.
  • Inventory tracked, for separating tracked variants from untracked.
  • One filter per registered attribute, so a filter for Color offers every option value registered under it, whether or not a variant uses it.

The attribute filters are the same ones Commerce’s own product and variant indexes get. See variant attributes.

Bulk edit a field#

Select variants, then choose Bulk edit field from the actions menu. Pick a field, set one value, and the action writes that value to every selected variant.

The field list is not every field on the variant. It comes from bulkEditableVariantFields in config/variant-manager.php:

'bulkEditableVariantFields' => ['careInstructions', 'inventoryTracked'],

Two limits:

  • Custom fields only, plus inventoryTracked. Price, SKU, dimensions, and weight are native Commerce properties, not custom fields, so they cannot be bulk edited. To change those across many variants, export the product, edit the column in a spreadsheet, and reimport. See exporting.
  • Config file only. The setting has no control panel screen.

Each field renders its own input, so a date field gets a date picker.

Once at least one handle in the setting matches a field on a variant field layout, the action appears for users with variant-manager:manage. See permissions.

We can take it from here.

We take on the Craft and Craft Commerce sites you built, so you can get back to building. Introduce a client who signs a management contract and you get a $3,000 partnership fee.

How the Dev Partnership Program works
See if we’re a fit