Variants and swatches
When a product has variants, such as sizes or flavors, the Product options block shows a picker for each option. As a customer chooses values, the price, stock and add to cart button change to match the variant, and the gallery moves to the variant’s image.
The page address also changes to the selected variant, so a customer who shares or bookmarks the page returns to the same variant.
Change how options look
Steps:
- From your Shopify admin, go to Online Store > Themes.
- Find Heirloom, and then click Edit theme.
- At the top of the theme editor, open the page selector, and then select Products > Default product.
- In the Product section, click Product options.
- Change the settings.
- Click Save.
The block shows only for products that have more than one variant. On a product with no options, it’s hidden on your online store.
Settings
- Option style: Buttons, dropdown for long lists shows buttons, and a drop-down menu for an option with more values than Use a dropdown above. Buttons always shows buttons. Dropdown always shows drop-down menus.
- Use a dropdown above: An option with more values than this shows as a drop-down menu when Option style is Buttons, dropdown for long lists. An option with swatches keeps its swatches.
- Swatch shape: The shape of color and image swatches. None shows every value as a text button, even when it has a swatch. This setting shows only when Option style is not Dropdown.
- Hide unavailable options: Hides sold-out option values instead of showing them struck through. The current selection still appears if it is sold out.
Buttons and dropdown menus
Option style has three choices.
- Buttons, dropdown for long lists is the default. Each value is a button, and an option with more values than Use a dropdown above shows as a drop-down menu. The threshold starts at 6, so a list of twelve flavors doesn’t fill the screen. Options with swatches keep their swatches.
- Buttons shows every value of every option as a button, and the selected value shows beside the option’s name. Buttons let customers see every choice at once.
- Dropdown shows every option as a drop-down menu. Use it when you prefer menus throughout.
A drop-down menu stops at a readable width. A store that saved Buttons or Dropdown keeps that choice.
Swatches
A swatch shows a value as a color or an image instead of its name, such as a dot of color for each flavor of a jam. Swatches show when Option style is Buttons or Buttons, dropdown for long lists, and Swatch shape is Circle or Square.
A value shows as a swatch when you give it a color or an image in your Shopify admin. To do this, give the product a category that has a color attribute, connect the option to a category metafield such as Color, and then give each value a color, or an image for patterns and textures.
Learn more about adding color swatches using category metafields in Shopify’s Help Center.
Values without a color or image show as text buttons, next to the swatches.
Sold-out and unavailable combinations
Heirloom checks each value against the values chosen before it. If no variant with that value can be bought, then the value is crossed out, and screen readers announce it as sold out. In a dropdown menu, the value reads “(Sold out)”. Customers can still select it to see the variant.
With Hide unavailable options on, those values are hidden instead. The selected value always shows, even when it’s sold out.
The add to cart button follows the selection:
- Sold out when the selected variant is sold out.
- Unavailable when the chosen combination of values doesn’t exist as a variant. The price then shows the product’s price, starting with “From” when variants have different prices.
To keep selling a variant when it’s out of stock, turn on Continue selling when out of stock for the variant in your Shopify admin. The variant then stays available, and the Stock block reads “Available to order”. Learn more about the Stock block.
Products with many variants
Shopify lets a product have up to 2,048 variants. Heirloom supports all of them, including products with more than 250 variants. The option pickers work the same way for a product with 2,000 variants as for one with two.
For products with up to 100 variants, the page loads the details of every variant at once. Above 100, the page loads the details of each variant as customers choose it.
Learn more about variants in Shopify’s Help Center.
Combined listings
A combined listing shows separate products as one product, with an option that switches between them. For example, three teas sold as separate products can show as one tea with a Blend option. Combined listings are made with Shopify’s Combined Listings app, which is available on Shopify Plus and enterprise plans.
In Heirloom, a value that belongs to another product links to that product’s page. When a customer selects it, the product section changes to the other product without reloading the page, and the page address changes to match. The section keeps the blocks and settings of the page that the customer started on.
Learn more about combined listings in Shopify’s Help Center.
Related
- Learn more about the product section.
- Learn more about product information blocks.
- Learn more about product cards.