How to show colour variants as different products on the collection page

How to show colour variants as different products on the collection page

bridget47
Excursionist
12 0 5

Hi I'd like the colours for each product to display on the collection pages. I've tried to duplicate a product but this causes chaos with inventory. Any tips?

 

I've seen some videos that use code but it hasn't worked and we'd like to do this without paying for an expensive app.

 

Here is our website:

https://smudj.co.za/collections/aw25-collection

Replies 6 (6)

Dotsquares
Shopify Partner
432 28 54

Hi @bridget47 Kindly follow the steps below:-

 

Go to Online Store > Themes > Edit Code
Open the snippet
Inside the product card loop insert the code:-

 

{% assign colors = '' %}
<ul class="product-colors">
{% for variant in product.variants %}
{% assign color = variant.option1 %}
{% unless colors contains color %}
<li class="color-swatch" style="background-color: {{ color | downcase }};"></li>
{% assign colors = colors | append: color %}
{% endunless %}
{% endfor %}
</ul>

 

And Add CSS for style --

 

.color-swatch {
display: inline-block;
width: 15px;
height: 15px;
border-radius: 50%;
margin-right: 5px;
border: 1px solid #ccc;
}

 

 

let me know if this works or you need a different approach.

 

 

Dotsquares Ltd


Problem Solved? ✔ Accept and Like solution to help future merchants.


Shopify Partner Directory | Trustpilot | Portfolio
bridget47
Excursionist
12 0 5

Gave it a try but it didn't work. not sure if I was clear sorry. Will this mean that someone will be able to see each colour on the collection page? for example this product has three colours and people can see that there are colour options but sometimes a different colour will catch they're eye first when they're scrolling through the collection: https://smudj.co.za/products/sam-cable-knit-sweater-light-grey-marl

 

 

Easify-Jolie
Shopify Partner
282 9 26

Hi @bridget47 

If you're looking for a no-code solution, you can try Easify Product Options. It lets you display color swatches on the collection pages without duplicating products or writing any code. The swatch feature is included in the free plan, so you can give it a try without any cost. Here's how it works:

  • This is the result:

EasifyJolie_0-1745470560068.png

 

  • This is the app setting: You just need to create color swatches for your products:

EasifyJolie_1-1745470803488.png

 

Then, go to the General Settings, in the Other pages section, select the Collection Page like this:

EasifyJolie_2-1745470873236.png

 

I hope this answer helps solve the problem. If you need further assistance, feel free to reach out to Easify anytime! 🤗

Easify Product Options: Any product options app can help you create custom options, but Easify turns those options into sales and conversions!
Easify Inventory Sync: Automate inventory syncing for Bundles, Duplicates, and Raw Materials. Say goodbye to manual tracking headaches.
Easify Product Attachments: Enrich your store with downloadable content. Easily add PDFs and other files to product or any page.
>>> Try Apps for Free | 24/7 Live Chat Support
bridget47
Excursionist
12 0 5

Hi My issue is not displaying colour swatches. I want each colour to display as a separate product. 

Abel_Lesle
Shopify Partner
276 5 21

Like how it does on Amazon for example right ?

 

 

Founder
Dollarlabs: Ultimate Discounts (5★) – If you can think of a discount, you can build it
Dollarback: Cashback & Loyalty (5★) – Simple cashback. Powerful loyalty.

Easify-Jolie
Shopify Partner
282 9 26

Hi @bridget47 

Thank you so much for your interest, and apologies if I misunderstood your question.

If you're looking to display each color as a separate product on the collection page, you can use the option URL feature in the app. This allows you to link each swatch color to a different product page—for example, clicking on the red swatch would take customers directly to the red version of the product. This approach does require creating individual products for each color.

 

If you'd prefer to achieve this without creating separate products, you may need to work with a developer for a custom solution. Thanks again, and please feel free to reach out if you need any assistance!

Easify Product Options: Any product options app can help you create custom options, but Easify turns those options into sales and conversions!
Easify Inventory Sync: Automate inventory syncing for Bundles, Duplicates, and Raw Materials. Say goodbye to manual tracking headaches.
Easify Product Attachments: Enrich your store with downloadable content. Easily add PDFs and other files to product or any page.
>>> Try Apps for Free | 24/7 Live Chat Support