Rubik Combined Listings

Swatch sorting and ordering Rubik Combined Listings Swatch

← Back to documentation

Overview

By default, swatches appear in the order you arranged the products inside the group (drag and drop on the Manage group page). On top of that manual order, the app offers optional rules that reorder swatches automatically: demote or hide sold-out products, put new arrivals first, sort alphabetically, sort by how much choice is actually in stock, or pin the product being viewed.

All rules live in Settings → Out-of-stock settings and Settings → Sorting settings, and they apply everywhere swatches render: product pages, collection and search page cards, featured product sections, and quick view.

The rules at a glance

Rule Settings section Default What it does
Hide out-of-stock swatches Out-of-stock settings Off Removes swatches for sold-out products entirely. The product currently being viewed is never hidden.
Push out-of-stock swatches to the end Out-of-stock settings On Moves sold-out products after the available ones (ignored when hiding is enabled).
Push new products to the start Sorting settings Off Newest first, by each product's publish date.
Sort products alphabetically Sorting settings Off A to Z by option value, with natural number handling ("Size 2" comes before "Size 10").
Sort by diversity of available variants Sorting settings Off Products with more distinct variants in stock (for example more available sizes) come first. Details below.
Show selected product first Sorting settings Off The product currently being viewed always appears first.

How the rules combine

You can enable several rules at once. When rules disagree, the higher one in this list wins:

  1. Show selected product first
  2. Hide out-of-stock swatches / Push out-of-stock swatches to the end
  3. Sort by diversity of available variants
  4. Push new products to the start
  5. Sort products alphabetically
  6. Your manual order from the Manage group page

Each rule only moves products it has an opinion about. Where a rule sees a tie (two products it would place equally), the next rule down decides, and when no enabled rule has an opinion, your manual order is kept.

For example, with Sort products alphabetically and Push out-of-stock swatches to the end both on, shoppers see the available products A to Z, followed by the sold-out products A to Z.

Sort by diversity of available variants

This rule puts the products that offer the most real choice first. The score is the number of distinct variants in stock, counted from each product's own native Shopify variants. In the typical combined-listings setup, where each color is its own product and sizes are its variants, the score is simply the number of sizes in stock.

Stock quantity does not matter, only how many different choices remain:

Product In stock Score
Blue jacket XS, S, M and XL (2 units each) 4
Green jacket Only XS (10 units) 1
Brown jacket Nothing in stock 0

With the rule enabled, shoppers see Blue first, then Green, then Brown. A few details worth knowing:

To enable it, open Settings → Sorting settings, turn on Sort by diversity of available variants, and save. Refresh your storefront to see the new order.

Good to know

Related guides