How to Add Product SKUs to Your Shopify Store Collection Pages
Published on Jun 6, 2024
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
- Improved product identification
- Easier inventory management
- 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:
- Log in to your Shopify admin panel
- Navigate to “Online Store” > “Themes”
- 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:
- Clear your theme cache
- Ensure you’ve added the code to the correct file
- Check if your products have SKUs assigned
Formatting Issues
If the SKU appears but looks out of place:
- Adjust the CSS to match your theme’s style
- 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:
- Use efficient liquid code
- Implement lazy loading for collection items
- 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?