How to Add Product SKUs to Your Shopify Store Collection Pages

Published on Jun 6, 2024

By Liam Gallagher

#Shopify#eCommerce#Web Development
Cheerful couple making online purchases at home

Are you looking to enhance your Shopify store’s collection pages by displaying product SKUs? Adding SKU information can provide valuable details to your customers and improve their shopping experience. In this comprehensive guide, we’ll walk you through the process of adding product SKUs to your collection pages in Shopify, covering various themes and customization options.

Understanding the Importance of SKUs on Collection Pages

What is an SKU?

SKU stands for Stock Keeping Unit. It’s a unique identifier assigned to each product variant in your inventory. Displaying SKUs on collection pages can help customers quickly identify specific products and streamline their shopping process.

Benefits of Showing SKUs on Collection Pages

  1. Improved product identification
  2. Easier inventory management
  3. Enhanced customer experience

Why Add SKUs to Collection Pages?

Adding SKUs to collection pages provides immediate access to important product information, helping customers make informed decisions without navigating to individual product pages.

Adding SKUs to Collection Pages: Step-by-Step Guide

Identifying Your Shopify Theme

Before making changes, it’s crucial to identify your current Shopify theme. Different themes may require slightly different approaches to add SKUs to collection pages.

Accessing Theme Files

To add SKUs to your collection pages, you’ll need to edit your theme files. Here’s how to access them:

  1. Log in to your Shopify admin panel
  2. Navigate to “Online Store” > “Themes”
  3. Click “Actions” > “Edit code” for your current theme

Locating the Correct File

The file you need to edit depends on your theme. Common files include:

  • product-card.liquid
  • product-grid-item.liquid
  • card-product.liquid

Adding the SKU Code

Once you’ve located the correct file, you’ll need to add a snippet of code to display the SKU. Here’s the most widely applicable code:

<div class="product-sku">SKU: {{ product.first_available_variant.sku | default: product.variants[0].sku }}</div>

Place this code snippet in the appropriate location within your product card template, typically near the product title or price.

Theme-Specific Instructions

Dawn Theme

For the Dawn theme, use the following code in the card-product.liquid file:

<div class="product-sku h5">{{ card_product.first_available_variant.sku | default: card_product.variants[0].sku }}</div>

Insert this code just before the vendor information:

{%- if show_vendor -%}
  <span class="visually-hidden">{{ 'accessibility.vendor' | t }}</span>
  <div class="caption-with-letter-spacing light">{{ product_card_product.vendor }}</div>
{%- endif -%}

Venture Theme

For the Venture theme, add this code to the product-card.liquid snippet:

<div class="product-item--vendor">{{ product.first_available_variant.sku | default: product.variants[0].sku }}</div>

Place it before the {{ product.title }} block.

Supply Theme

In the Supply theme, use the following code in the product-grid-item.liquid snippet:

<div class="product-item--vendor">{{ product.first_available_variant.sku | default: product.variants[0].sku }}</div>

Insert this code just before the {{ product.title }} block.

Customizing the SKU Display

Styling the SKU

To make the SKU display match your theme’s aesthetics, you can add custom CSS. Here’s an example:

.product-sku {
  font-size: 0.9em;
  color: #666;
  margin-top: 5px;
}

Add this CSS to your theme’s custom CSS file or within “ tags in the appropriate liquid file.

Conditional Display

You may want to show SKUs only for certain products or collections. Use Liquid conditionals to achieve this:

{% if product.type == 'Specific Type' %}
  <div class="product-sku">SKU: {{ product.first_available_variant.sku | default: product.variants[0].sku }}</div>
{% endif %}

Handling Multiple Variants

For products with multiple variants, you might want to update the SKU when a customer selects a different variant. This requires JavaScript and is typically implemented on the product page rather than the collection page.

Troubleshooting Common Issues

SKU Not Displaying

If the SKU doesn’t appear after adding the code, try the following:

  1. Clear your theme cache
  2. Ensure you’ve added the code to the correct file
  3. Check if your products have SKUs assigned

Formatting Issues

If the SKU appears but looks out of place:

  1. Adjust the CSS to match your theme’s style
  2. Ensure the code is placed in the correct location within the product card template

Performance Considerations

Adding SKUs to collection pages may slightly increase page load time. To mitigate this:

  1. Use efficient liquid code
  2. Implement lazy loading for collection items
  3. Optimize your images and other assets

Best Practices for SKU Display

Keep It Simple

Display the SKU in a clear, concise manner without cluttering the product card.

Consistency is Key

Ensure that SKUs are displayed consistently across all collection pages and product types.

Consider Mobile Users

Make sure the SKU display is responsive and easily readable on mobile devices.

By following this guide, you should be able to successfully add product SKUs to your Shopify store’s collection pages, enhancing the shopping experience for your customers and improving your inventory management capabilities.

Take Our Quick Quiz:

Which primary product image do you think has the highest conversion rate?