Skip to Content
Account
Enter the email address on your account.
Forgot Your Username?
Enter your password.
Forgot Your Password?

Or continue with

J2Commerce 6

Variable Products

15 Min Read
On This Page

A Variable product lets you sell one product in multiple variations — for example, a T-shirt in different sizes and colors. You define the options (Size, Color), assign which values each option can take, and J2Commerce automatically generates every possible combination as a separate variant. Each variant can have its own price, SKU, stock level, weight, and image.

Variable products are ideal when your product has clearly defined option combinations and you want each combination managed and tracked independently.

How Variable Products Differ from Other Types

Variable: Best for products where every size/color combo is tracked separately

Configurable: Best for complex product families needing full independent catalog entries

Flexivariable: Best for products where combinations are not systematic

With Variable products, the variant generation is automatic — you do not create each combination by hand.

Requirements

  • PHP 8.3+
  • Joomla! 6.x
  • J2Commerce 6.x

Tip

IMPORTANT: Once you have configured the settings for any product, check to see if those specific items are showing up on the frontend. If they are not, (ie: filters, cross-sells, price, title, etc), then go to your store menu and show or hide the items you want to control on the frontend. Go to Menu -> Main Menu -> Store -> Product tab

Store menu item edit screen with the Title Store and the Product tab highlighted among Details, Common, Categories and Category tabs

Info

NOTE: Before you can begin setting up a Variant, you need to create all of the Options that the product will offer.

Setting Up Options (if needed)

There are two ways you can access Options.

Option A: Go to the J2Commerce icon at the top right corner -> Catalog -> Options

Option B: Go to Components on the left sidebar -> J2Commerce -> Dashboard -> Catalog -> Options

Adding new options

Select New to create a new option. (for example, Name: Size, Type: select).

Add the option values (Small, Medium, Large) to the option

Repeat for each option you plan to use (e.g., create a separate "Color" option with values Red, Blue, Green).

You only need to do this once. The same options can be reused across many products.

Option Name: The label customers see on the product page, for example, "Size" or "Color".

Option Unique Name: An internal identifier (no spaces) used to distinguish options with the same display name.

Type: Controls the input style shown to customers. See the table below for all types.

Option Types

Select: A dropdown menu

Radio: Clickable button group

Checkbox: Multiple-choice checkboxes

Color: Color swatch buttons

Text: A single-line text input

Textarea: A multi-line text input

Date / Datetime / Time: A date or time picker

Number: A numeric input field

File / Image: A file upload input

Email / URL: A formatted text input

Tip

IMPORTANT: For Select, Radio, Checkbox, and Color option types, add your option values in the Option Values section that appears below the type field. Each value needs a name, and optionally an image.

Option edit screen, Option Values section highlighted listing Value Names Black, White, Red, Pink and Dark Grey with an Image field for each

Create a New Product Article

Variable products in J2Commerce are attached to Joomla articles.

There are many ways you can access products or articles.

Option A: Go to the J2Commerce icon at the top right corner -> Catalog -> Products -> New

Option B: Go to Components on the left sidebar -> J2Commerce -> Products -> New

Option C: Go to Content -> Articles -> New

Joomla products list after an article is saved, with the Content, Components and Products menu entries and the J2Commerce menu Products item highlighted

Setting up the Product

Article edit screen for Go Ballsy T-Shirt with Title, Content tab, Status and Category labels highlighted, Category set to Merch

Give the article a title (e.g., "Classic T-Shirt").

Add your product description in the article body.

Info

Note: The intro description above the red 'Read More' line will appear under the main title of the product. The main description will appear under the description tab below the product

The intro description above the red 'Read More' line will appear under the main title of the product. The main description will appear under the description tab below the product

Set the article's state to Published.

Assign the article to the appropriate category.

Frontend View

Go Ballsy T-Shirt product page with the title, short description and Description tab content highlighted below the color and size options

Add J2Commerce Details to the Article

New article, J2Commerce tab highlighted: Use As Product Yes, Product Type dropdown open with Variable highlighted and Save and Continue highlighted

Open the Product Article -> J2Commerce tab

Use as Product: Select 'Yes'

In the Product Type dropdown, select Variable.

Click Save and Continue

General Tab

The General tab sets product-wide settings that apply to the whole product, not individual variants.

Product edit screen, General tab highlighted: Visible in Storefront Yes highlighted, with empty Brand or Manufacturer, Vendor and Tax Profile fields

Visible in Storefront: Show or hide the product in storefront listings. Set to 'Yes' to make it visible to shoppers.

Brand or Manufacturer: Links this product to a manufacturer record. Useful for filtering and for the Custom Accordions app's Brand Details feature.

Info

NOTE: You have to set up the Manufacturer details in both an Article and under J2Commerce -> Catalog -> Manufacturer, in order for them to appear in the dropdown menu

Vendor: Assigns the product to a vendor. Relevant for multi-vendor setups. Leave blank if you do not use vendors.

Info

NOTE: You have to set up the Vendor's details in both an Article and under J2Commerce -> Catalog -> Vendors, in order for them to appear in the dropdown menu

Tax Profile: Assigns a tax profile to this product. The tax profile determines which tax rates apply based on the customer's location. Create tax profiles under J2Commerce -> Taxes.

Cart Button Text: Customize your cart button name. This will override the default "Add to Cart" button label for this product only. Leave blank to use your store's global button label.

Product CSS Class: Adds one or more CSS class names to the product's container element. Useful for per-product styling without modifying template files.

Image tab

Product edit screen, Images tab highlighted: main white t-shirt image with alt text caption highlighted, four more thumbnails and the add tile highlighted

On the Images tab, click Upload Image or drag image files directly into the upload area.

  • Supported formats: JPG, JPEG, PNG, GIF, WebP, AVIF.

  • The main image appears on the product detail page and in category listings.

  • Gallery images appear in the image gallery on the product page.

  • Individual variants can also have their own images — you set those later.

Frontend View

Go Ballsy T-Shirt product page with the image gallery highlighted: grey shirt photo, arrows, zoom button and thumbnail row beside the variant options

Image Order and the Main Image

Product edit screen, Images tab highlighted with the main image's arrow button highlighted, beside four thumbnails with alt text captions

The first image in the uploader is the main product image — the large image shown on the product detail page and used as the thumbnail in listings. To reorder:

  1. Hover over an image card to reveal the left and right arrows.
  2. Click the arrows to move the image to a new position.
  3. Save the product to apply the new order.

Automatic Thumbnails

J2Commerce automatically generates resized thumbnails and tiny versions of each uploaded image. These are used in product listings, the cart, and other compact views. No extra configuration is needed — the sizes are set in your store's image configuration.

Alt Text

Each image card has an Alt Text field. Write a short description such as "Blue ceramic mug, 350ml". Alt text is read by screen readers and used by search engines to understand your images.

Removing Images

Clicking Remove on a card removes the image from this product but does not delete the file from the server. To delete the file permanently, use the file browser icon in the uploader.

Creating Variants

The Variants tab is where the core Variable product workflow happens. It has two sections: Options at the top and Variants below.

Add Options to the Variant

The Options section shows which options define the combinations for this product.

Product edit screen, Variants tab highlighted: the option dropdown set to Size and the Add Option button highlighted

  1. In the Search and Add Variant Option dropdown, select the first option (e.g., "Size").
  2. Click Add Option.
  3. The option appears in the table. Repeat to add more options (e.g., "Color").

You can set an ordering number for each option to control which option the customer sees first.

Info

Note: If no options exist yet, a warning appears with a link to create options. You must first create options under J2Commerce -> Catalog -> Options.

Set Option Values for This Product

After adding an option that uses a dropdown (select), radio, or color type, a Set Option Values button appears next to it.

Product edit screen, Variants tab highlighted: Color and Size options, with the Set Option Values button for Color highlighted

  1. Click Set Option Values next to an option.

  2. A panel opens showing all available values for that option.

  3. Click Add All to include every value, or add values individually.

    Set Options for Color dialog: dropdown with Black and Create button highlighted, Current Option Values highlighted listing White and Heather Grey

  4. Click Save Changes when done.

  5. Repeat for every option on the product.

Generate Variants

Once options and their values are configured, J2Commerce can generate all possible combinations. You can delete the individual ones that won't apply to your product

Product edit screen, Variants tab: Color and Size options with Set Option Values buttons, and the Generate Variants button highlighted above No results found

In the Variants section below the Options table, click Generate Variants.

Confirm the prompt

For example, if Size has 3 values (S, M, L) and Color has 2 values (White, Gray), J2Commerce generates 6 variants: S/White, S/Grey, M/White, M/Grey, L/White, L/Grey.

Generated variants list with the Variants heading highlighted, showing White-XS first and Heather Grey-XS highlighted, plus Regenerate and Delete All buttons

The variants appear as an accordion list. Each variant is collapsible.

Frontend Product View of Options

Go Ballsy T-Shirt product page with the Color and Size option block highlighted: Heather Grey and XS selected among White and sizes XS to 3X

Frontend Category View of Options

Info

Note: Below the category title will appear the variant options with a dropdown arrow, allowing the customer to view all options without leaving the category page

Merch category page with the T-Shirt options link expanded and highlighted, showing Color White and Heather Grey and Size XS to 3X buttons

Configure Individual Variants

Every generated variant can be expanded and configured independently.

To open/close them individually, click on the up/down arrow on the left of the titles.

To open/close them all at the same time, click on the up/down arrow in the top right corner.

Variants list with the Open All expand button and a single variant's expand arrow highlighted, next to Regenerate Variants and Delete All Variants

Each variant has four configuration sections:

General Section

Expanded White-XS variant with the General section highlighted: SKU wt-ts-xs, Regular Price 21.69, Pricing Calculator Standard, plus Shipping and Inventory columns

SKU: The unique stock-keeping unit code for this variant. Filled automatically with a default value; update it to match your inventory system.

UPC: Optional barcode or Universal Product Code for this variant.

Regular Price: The selling price for this specific variant. Each variant can have a different price.

Advanced Pricing: Opens a modal to configure sale prices, customer-group pricing, or date-range discounts for this variant.

Pricing Calculator: Controls how the price is calculated at checkout. Leave set to Standard unless you have a custom pricing calculator plugin.

Frontend View - General Section

Go Ballsy T-Shirt product page with the price $21.69 and the variant SKU hg-ts-xs highlighted, Heather Grey and XS selected

Shipping Section

Expanded White-XS variant with the Shipping section highlighted: Enable Shipping Yes, Length Class Inch, dimensions and weight at 0, Weight Class Pound

Enable Shipping: Set to Yes if this variant is a physical item that requires shipping. Set to No for digital or service variants.

Length Class: The unit of measurement for dimensions (e.g., centimetre, inch).

Dimensions: The physical dimensions of the variant: length, width, and height. Used by shipping rate calculators.

Weight: The physical weight of this variant.

Weight Class: The unit of measurement for weight (e.g., kilogram, pound).

Inventory Section

Expanded White-XS variant with the Inventory section highlighted: Manage Stock No, Stock Quantity 0, Allow Backorders Do not allow, Stock Status In Stock

Manage Stock: Select 'Yes' to track stock levels for this variant. If you have an unlimited inventory supply, then you don't need to manage stock quantity

Quantity: Current stock quantity for this variant.

Allow Backorders: Whether customers can order this variant when it is out of stock.

Stock Status: Manual override for whether the variant shows as in-stock or out-of-stock.

Notify Quantity: Send a low-stock notification when the quantity drops to this number.

Quantity Restriction: Limit how many units a customer can purchase in one order.

Max Sale Quantity: Maximum units per order, when Quantity Restriction is enabled.

Min Sale Quantity: Minimum units per order.

Image

Expanded White-XS variant with the Product Images section highlighted: a white t-shirt image, an add tile and Use Main Image as Thumbnail Yes

Tip

Tip: Each variant can have its own individual images. This is very helpful to the customer to see the differences in the options. ie: color, flavor, size, etc. When the customer selects a specific option on the product page, the corresponding image will appear.

Main Image: The primary image shown when a customer selects this variant combination.

Use Main Image as Thumbnail: When enabled, the product's main image is used as the thumbnail for this variant instead of a variant-specific image.

Each variant can have its own main image and gallery images. This is useful when Red and Blue variants look completely different.

Frontend View of the image changing depending on which option is selected

Go Ballsy T-Shirt product page with the gallery highlighted and the Heather Grey color and XS size buttons highlighted as selected

Set a Default Variant

Variants list with the Variants heading highlighted and the filled default star on the first variant, White-XS, highlighted among variants V1 to V3

One variant needs to be marked as the default — this is the combination shown and priced when the product page first loads.

In the variant list, click the star icon on the variant you want as the default. A filled star indicates the default variant. You can change the default item by clicking the star on another variant.

Managing Variants Over Time

As your product line evolves, you may need to update variants.

Regenerating Variants

Variants list with the Regenerate Variants button highlighted next to Delete All Variants, above variants White-XS to White-XL

If you add a new option value later (e.g., a new color), click Regenerate Variants in the Variants tab. J2Commerce adds new combinations for the new value while preserving existing variants and their prices, stock, and images.

Deleting Variants

Product Variants list with the select-all checkbox, delete icon and Delete All Variants button highlighted next to Regenerate Variants

  • To delete a single variant: expand it and click the delete button.
  • To delete multiple variants: check the checkboxes and click the delete button in the toolbar.
  • To delete all variants and start over: click Delete All Variants.

Browsing Many Variants

If a product has many variants, they are paginated. Use the page numbers below the accordion list to navigate between pages.

Filters Tab

Filters allow shoppers to narrow product listings by attribute — for example, filtering by material, color range, or size range. Assigning filters here makes this product appear in the correct filtered results on category and tag pages.

To assign a filter value:

  1. Type part of the filter name in the search box. Results appear in a dropdown.
  2. Click the matching result to add it to the product.
  3. Repeat for each filter value you want to assign.
  4. To remove a filter, click the trash icon next to it.

Filters are created and organized under J2Commerce -> Catalog -> Filters.

Frontend View of Filters on Products

They will appear under the Specification tab

T-shirt product page with the Specifications tab highlighted, showing Color White, Grey and Size X-Small through XL-3X

The filters section will always appear on the Categories page but will only show up on the individual product pages if you choose to configure the product that way.

Frontend View of Filters on Categories

Merch category page with the Filters heading highlighted, and the Color and Size filter groups highlighted beside the T-Shirt and Tumbler cards

Relations Tab

Product edit screen, Relations tab highlighted with Up Sells and Cross Sells sections highlighted, each listing three related products

Up-sells: Products to recommend as upgrades on this product's detail page. Typically shown as "Add these to your order" with products that will complement the order. ie: parts for a specific tool, extenders, etc...

Cross-sells: Products to suggest as complementary purchases or are similar. Typically shown as "You might also like" with higher-value alternatives. They can be placed at the bottom of the product page, in the cart sidebar, or at checkout.

To add a related product, start typing its name in the search box. Matching products appear in a dropdown — click one to add it. Remove a related product by clicking the trash icon next to it.

Frontend View of Related Products

T-shirt product page with Specifications showing Color and Size, and the Add These to Your Order and You May Also Like sections highlighted with product cards

Apps Tab

Flexible variable product edit screen with the Apps tab highlighted beside General, Images, Variants, Filters and Relations, listing Custom Tabs and Custom Accordions

The Apps tab shows product-level configuration panels provided by installed app plugins. For example:

  • If you have the Custom Accordions app enabled, you can add accordion sections directly on this tab.
  • If you have the Gift Wrapping app enabled, its per-product settings appear here.

Each app is responsible for its own content on this tab. If no apps are installed, the tab shows an information message.

How It Works on the Storefront

When a customer views a Variable product:

  1. The product page displays option selectors (dropdowns, radio buttons, or color swatches, depending on the option type).
  2. As the customer makes selections, J2Commerce updates the price, image, and stock status via AJAX — no page reload.
  3. Once all options are selected, the correct variant is identified and the Add to Cart button becomes active.
  4. Adding to the cart validates that the selected combination exists and has stock available.
  5. The cart shows the selected option values alongside the product name.

In category listing views, if your store settings show the cart on the listing page, option selectors also appear there so customers can add directly from the list.

Tips

  • Set prices on variants, not the article — the variant price is what customers see and pay. The article itself has no price field for Variable products.
  • Use a default variant — always mark one variant as the default so the product page shows a valid starting price.
  • Set values before generating — configure option values for each option before clicking Generate Variants. You can regenerate later to add new combinations.
  • Enable inventory per variant — if you need to track stock per size and color separately, enable Manage Stock and set Quantity on each variant individually.
  • Reuse options — create your Size and Color options once under Options and reuse them across multiple products.

Troubleshooting

Variants Not Generating

Cause: No option values have been assigned to the product options, or the options are of a type that does not support value selection.

Solution:

  1. Go to the Variants tab and click Set Values next to each option.
  2. Confirm that at least one value is assigned and saved for each option.
  3. Click Generate Variants again.

Product edit screen, Variants tab highlighted: Set Option Values buttons for both Color and Size highlighted, Flavor in the option dropdown

Option Values Not Appearing in the Set Values Panel

Cause: The option's global value list is empty.

Solution:

  1. Go to J2Commerce -> Catalog -> Options.
  2. Open the option (e.g., Size) and verify it has values listed.
  3. Add any missing values and save the option.
  4. Return to the product and click Set Values again.

Option edit screen: Option Name Size, Unique Name size, Option Type Radio, Status Published, and Option Values 20oz, 11oz, 15oz and XS highlighted

Add to Cart Button Stays Disabled

Cause: Not all option selectors have been chosen by the customer, or the selected combination has no matching variant.

Solution (admin):

  1. Open the product and go to the Variants tab.
  2. Verify that a variant exists for every possible combination of option values.
  3. If some combinations are missing, click Regenerate Variants.

Variants list with the Regenerate Variants button highlighted next to Delete All Variants, above variants White-XS to White-XL

Price Does Not Update When Selecting Options

Cause: A default variant is not set, or JavaScript is blocked.

Solution:

  1. Open the product, go to the Variants tab, and click the star icon on one variant to set it as the default.
  2. Save the product.
  3. Verify that JavaScript is enabled and not blocked by browser extensions.

Variants list with the Variants heading highlighted and the filled default star on White-XS highlighted among variants V1 to V3

Variant Image Does Not Change on Selection

Cause: No image has been uploaded for that variant.

Solution:

  1. Expand the variant in the Variants tab.
  2. Go to the Image section and upload a main image for the variant.
  3. Set Use as Thumbnail to Yes if you want the listing thumbnail to change, too.
  4. Save the product.

Expanded White-XS variant with the Product Images section highlighted: a white t-shirt image, an add tile and Use Main Image as Thumbnail Yes

Still stuck? Our team can help.

Back to Top