May 12, 2025

How to Show All Variants on a Collection Page in Shopify

Arrow pointing left
back to blog

about

Learn how to show all variants on a collection page in Shopify to create a more immersive shopping experience for your customers.

the author

Adam Ritchie
Ecommerce Contributor

share this post

One of the most common customizations that Shopify merchants want to make to their collection pages is adding all the available variants below each product. But you’ll often find that there’s no easy solution for doing this directly in the Shopify admin. 

Indeed, in most cases there are only two ways in Shopify to show all variants on a collection page — you can custom-code your own solution, or you can skip the coding and use a third-party app to implement this feature instead. We’ll go over both of these methods in detail below:

Create custom collection pages with easeShogun Page Builder offers an intuitive interface and a powerful set of editing tools, enabling brands to create customized content for their Shopify storefront.Get started now

Modifying the Code in the Collection Template to Show All Variants

Each Shopify theme offers its own set of default customization settings, which can be accessed through Shopify’s built-in theme editor. The exact options available to you will depend on which theme you’re using.

For example, if you’re using Shopify’s default Dawn theme, you’ll find that the built-in theme editor offers several ways to customize the product grid block on collection pages. This includes settings for adding product ratings, adjusting the product image ratio, and determining whether or not a second image is shown when the visitor hovers their cursor over the product image — but there’s no option for showing all the variants below each product.

Shopify’s default Dawn theme doesn’t offer a built-in customization option for showing variants on collection pages.

When there’s no default customization setting for a feature that you want to implement, one workaround is that you can always code it yourself. 

Thankfully, Shopify makes it easy to add custom code to your storefront. Here’s how:

  • Log in to your Shopify account and select the “Online Store” option in the left sidebar of the main control panel. 
  • Open the “…” menu next to the theme you’re currently using.
  • Select “Edit code”.
Select “Edit code”. 

This will take you to Shopify’s code editor, where you can access and edit all of your theme files.

To show all variants on your collection pages, you’ll first need to go to the “sections” folder in your theme files and open “main-collection-product-grid.liquid”. It’s worth noting again that we’re using the Dawn theme; if you’re using a different theme then the relevant file may have a different name. But even in that case, the name should only be slightly different, so just look for something similar. 

Now, copy the following code:

{% if request.page_type == 'collection' %}
                    {% if product.variants.size > 1 %}
                      <div class="product-variant-dropdown">
                        <form action="/cart/add" method="post" >
                            <select name="id" class="product-variant-select">
                              {% for variant in product.variants %}
                                  {% if variant.available %}
                                      <option value="{{ variant.id }}">{{ variant.title }}</option>
                                  {% else %}
                                    <option disabled="disabled">{{ variant.title }} - Sold Out</option>
                                  {% endif %}
                              {% endfor %}
                            </select>
                            <input type="submit" value="Buy now" class="product-variant-submit-button" />
                        </form>
                      </div>
                    {% endif %}
                  {% endif %}

                  {% if product.has_only_default_variant %}
                    <form method="post" action="/cart/add">
                       <input type="hidden" name="id" value="{{ product.variants.first.id }}" />
                       <input type="submit" value="Buy now" class="product-variant-submit-button" />
                    </form>
                  {% endif %}

Next, for this example, we’re going to paste our code where the red arrow is pointing in the screenshot below, just above “</li>”. It’s yet again worth mentioning that we’re using the Dawn theme here. If you’re using a different theme, the place where you need to insert your code may be a bit different — but by looking for a similar section of code and using a little trial and error if necessary, you should be able to find it without too much trouble.

Add your custom code to the “main-collection-product-grid.liquid” file.

Save your changes to “main-collection-product-grid.liquid”. 

Save the “main-collection-product-grid.liquid” file.

Now, go to the “Assets” folder, open “base.css”, and add the following code to the bottom of this file:

.card-wrapper {
  height: auto!important;
}
.product-variant-dropdown{
  display:block !important;
} 
.product-variant-submit-button {
  background-color: #121212;
  color: #fff;
  padding: 12px 25px;
  border-radius: 0px;
  border: 1px solid #121212;
  display: block;
  margin-bottom: 15px;
}
.product-variant-submit-button:hover {
  background-color: #fff;
  color: #121212;
  cursor: pointer;
}
.product-variant-select {
  border: 1px solid #121212;
}
.product-variant-select:focus-visible {
  outline: none;
  box-shadow: none;
}
.product-variant-select {
  padding: 10px 10px;
  display: block;
  width: 100%;
  margin-bottom: 10px;
}

Don’t forget to save your changes.

Save the “base.css” file after making your changes.

Once you’ve successfully added the code above, each product card on your collection pages will now have a dropdown menu that displays all the variants that are available. 

After editing your theme code, all variants will now be shown on your collection pages.

Visitors will even be able to select a variant and then add the item to their cart directly from the collection page — by removing a step from the purchasing process like this, you’ll make it easier for customers to place an order on your store, which should in turn lead to a higher conversion rate and more sales.

Create custom collection pages with easeShogun Page Builder offers an intuitive interface and a powerful set of editing tools, enabling brands to create customized content for their Shopify storefront.Get started now

Using Shogun Page Builder To Import and Edit Collection Pages

You could also use Shogun Page Builder to show all variants on your Shopify collection pages — and with this method, you won’t need to touch any code. 

If you’d like to edit one of your existing collection pages with Shogun, you first must import it:

  • After installing Shogun Page Builder, select the “Apps” option in the left sidebar of the main Shopify control panel.
  • Open Shogun Page Builder. 
  • In the “Pages” section of Shogun Page Builder, you’ll see two tabs — “Shogun” and “Shopify”. Open the “Shopify” tab. 
  • In the “Shopify” tab, you’ll find all of the pages that haven’t yet been imported into Shogun. Use the page type filter to narrow the listings down to only collection pages, then click on the “Import page” button next to the collection page you want to import.
  • In the “Page layout options” section of the import settings, select “Shopify 2.0 sections”. Then, click on the “Import this page” button.
Select “Import this page”. 

Now, you’ll be able to add your variants and make any other edits you want to your imported page:

  • Return to the “Pages” section of Shogun Page Builder, but this time go to the “Shogun” tab — this is where you’ll find all of your pages that have already been imported into Shogun. 
  • Click on the collection page you just imported to open it in the editor. 
  • Once you’re in the editor, the first thing you should do is delete the original “Product grid” section that was imported from Shopify — we’re going to replace this with a highly customizable Shogun element. So, select the “Product grid” section, then click on the trash can icon in the section’s settings (these settings are found in the right sidebar of the editor).
  • Next, click on the “Elements” icon in the left sidebar of the editor (it’s the one that looks like a plus sign inside of a circle) to open the element library. 
  • Scroll down to the “Shopify” section of the element library. These elements pull data directly from your Shopify catalog, eliminating the need to input product details manually. Drag the “Collection” element to where you want your products to be placed on the page, then select the collection you want to connect it to.
Connect the “Collection” element to one of the product collections in your Shopify catalog.

By default, each product in the collection will then be added to the page with its own product image, title, price, and add-to-cart button. If you’d like to add any more product details, just go back to the Shopify section of the element library and drag whatever other element you want to include wherever you want it to be located.

For example, you could add the “Variant” element from the “Shopify” collection. As mentioned above, the corresponding product data will automatically populate once the element has been placed on the page. You can also set it up so that whenever you make changes to one product in a “Collection” element, the change is applied to all products. That means you’ll be able to add all variants to your collection page with just a single movement of your mouse.

Add the “Variant” element into the “Collection” element.

And as with all other Shogun elements, there are myriad ways to customize both the styling and functionality of the “Variant” element. These options include:

  • Sold out variants: Determine whether sold out variants are hidden, shown but not selectable, or shown and selectable.
  • Show as: You can display your variants as either a dropdown menu or a set of buttons.
  • Labels: Choose a font, size, text color, and alignment for your variant labels. You can determine whether these labels are shown at all as well. 
  • Dimensions: Set the exact amount of pixels you want for the height and width of your “Variant” element.
  • Spacing: You can also decide how many pixels are separating your “Variant” element from the surrounding elements on the page.
  • Border: You have four border options to choose from — none, solid, dashed, or dotted. Also, you can customize the border color, border thickness, and border radius (how rounded the corners are). 
  • Box shadow: You can add a box shadow to your “Variant” element and customize its horizontal offset, vertical offset, blur, and spread. 
  • Visability: If you’d like, you can make it so that the “Variant” element can be seen on some types of devices but not others. This setting is especially helpful for mobile design, as it may be necessary to pare back some features in order to make your site easier to navigate on the smaller screens of smartphones and tablets.

In addition to the “Variant” element and everything else in the “Shopify” section of the element library, Shogun also provides all kinds of other features that you can use to improve your site. 

The “Structure” elements will allow you to establish page layouts just the way you want them (you can set up columns, sliders, tabs, etc.), and the “Content” elements enable you to add everything from text and images to interactive maps and countdown clocks. And with the “Forms” elements, you’ll be able to quickly build your own custom forms as well, complete with ReCaptcha security to help protect against spam and fraud.

Overall, no matter your design preferences, business goals, or any other variable, Shogun gives you everything you need to create the perfect Shopify collection page for your specific store.

Create custom collection pages with easeShogun Page Builder offers an intuitive interface and a powerful set of editing tools, enabling brands to create customized content for their Shopify storefront.Get started now

You might also enjoy

Get started for free

Get hands on with everything you need to grow your business with a comprehensive suite of tools.
Start now
Arrow pointing up and to the right Arrow pointing up and to the right